       OSAtomicIncrement32Barrier(&self.waiting)
 
     dispatch_sync(queue) {
+
       OSAtomicDecrement32Barrier(&self.waiting)
       task()
     }

      OSAtomicIncrement32Barrier(&self.waiting)

    dispatch_async(queue) {
      OSAtomicDecrement32Barrier(&self.waiting)
      task()
    }

    {
      dispatch_suspend(queue)
      state = Suspended
      OSMemoryBarrier()
    }
  }

  /**
    Resume the queue if it is suspended
  */

  final func resume()
  {
    if state != Running
    {
      while state == Transient
      {
        // Busy-wait for a very short time
        // A resume() call must succeed in order to avoid deadlocks.
        // A suspend() call can fail: the queue will get another chance
        OSAtomicIncrement64Barrier(&busy) // OSMemoryBarrier()
      }
      if OSAtomicCompareAndSwap32Barrier(Suspended, Transient, &state)
      {
        dispatch_resume(queue)
        state = Running
        OSMemoryBarrier()
      }
    }
  }

