       waiter.initialize(to: Waiter(source: source))
 
       repeat {
-        waiter.pointee.next = state.waiters?.assumingMemoryBound(to: Waiter<Value>.self)
+        waiter.pointee.next = waiterQueue(from: state)
         let newState = Int(bitPattern: waiter) | state.state
         if CAtomicsCompareAndExchange(deferredState, &state, newState, .weak, .release, .relaxed)
         { // waiter is now enqueued; it will be deallocated at a later time by notifyWaiters()

      resolved.deinitialize(count: 1)
      resolved.deallocate()
    }
    else if let w = state.waiters
    {
      deallocateWaiters(w.assumingMemoryBound(to: Waiter<Value>.self))
    }
    deferredState.deallocate()
  }


  var isResolved: Bool { return (self & .stateMask) == .resolved }
  var state: Int { return self & .stateMask }

  var pointer: UnsafeMutableRawPointer? { return UnsafeMutableRawPointer(bitPattern: self & ~.stateMask) }
}

