       }
 
       if r != nil
-      {
+      { // another thread succeeded ahead of this one
+        assert(r != p)
         p.deinitialize(count: 1)
         p.deallocate(capacity: 1)
         return false

  }

  /// Set the `Result` of this `Deferred`, change its state to `DeferredState.determined`,
  /// enqueue all notifications on the dispatch_queue, then return `true`.
  /// Note that a `Deferred` can only be determined once. On subsequent calls, `determine` will fail and return `false`.
  /// This operation is lock-free and thread-safe.
  ///

    {
      let waitQueue = waiters
      if CAS(current: waitQueue, new: nil, target: &waiters)
      { // only this thread knows the pointer `waitQueue`.
        WaitQueue.notifyAll(queue, waitQueue, result)
        break
      }
