   @discardableResult
   fileprivate func resolve(_ result: Result<Value, Error>) -> Bool
   {
-    let originalState = deferredState.load(.relaxed).state
+    let originalState = CAtomicsLoad(deferredState, .relaxed).state
     guard originalState != .resolving else { return false }
 
-    let updatedState = deferredState.fetch_or(.resolving, .acqrel).state
+    let updatedState = CAtomicsBitwiseOr(deferredState, .resolving, .acqrel).state
     guard updatedState != .resolving else { return false }
     // this thread has exclusive access
 

  let queue: DispatchQueue

  private var resolved: Result<Value, Error>?
  private var deferredState: AtomicInt

  deinit
  {
    let s = deferredState.load(.acquire)
    if !s.isResolved, let w = s.waiters
    {
      deallocateWaiters(w.assumingMemoryBound(to: Waiter<Value>.self))
    }
  }

  // MARK: designated initializers


  open func enqueue(queue: DispatchQueue? = nil, boostQoS: Bool = true, task: @escaping (_ result: Result<Value, Error>) -> Void)
  {
    var state = CAtomicsLoad(deferredState, .acquire)
    if !state.isResolved
    {
      let waiter = UnsafeMutablePointer<Waiter<Value>>.allocate(capacity: 1)
