   static let resolved =  0x3
   private static let stateMask = 0x3
 
-  var isResolved: Bool { return (self & .stateMask) == .resolved }
-  var state: Int { return self & .stateMask }
-
-  var pointer: UnsafeMutableRawPointer? { return UnsafeMutableRawPointer(bitPattern: self & ~.stateMask) }
+  init(_ pointer: UnsafeMutableRawPointer, tag: Int)
+  {
+    self = Int(bitPattern: pointer) | (tag & .stateMask)
+  }
+
+  var isResolved: Bool { return tag == .resolved }
+
+  var tag: Int { return self & .stateMask }
+  var ptr: UnsafeMutableRawPointer? { return UnsafeMutableRawPointer(bitPattern: self & ~.stateMask) }
 }
 
 /// An asynchronous computation.

  private func resolvedPointer(from state: Int) -> UnsafeMutablePointer<Result<Value, Error>>?
  {
    guard state.isResolved else { return nil }
    return state.pointer?.assumingMemoryBound(to: Result<Value, Error>.self)
  }

  /// Get a pointer to the first `Waiter` for an unresolved `Deferred`.


      repeat {
        waiter.pointee.next = waiterQueue(from: state)
        let newState = Int(waiter, tag: state.tag)
        // read-modify-write `deferredState` with memory_order_release.
        // this means that this write is in the release sequence of all previous writes.
        // a subsequent read-from `deferredState` will therefore synchronize-with all previous writes.
