       // thread was awoken by close() and put() has failed
       return false
 
+    case &newElement:
+      // the message was succesfully passed.
+      return true
+
     default:
-      assert(context == &newElement)
-      return true
+      preconditionFailure("Weird context value in \(__FUNCTION__)")
     }
   }
 

    dispatch_semaphore_wait(threadLock, DISPATCH_TIME_FOREVER)

    // got awoken
    let context = UnsafeMutablePointer<T>(dispatch_get_context(threadLock))
    dispatch_set_context(threadLock, nil)
    SemaphorePool.enqueue(threadLock)


      OSSpinLockUnlock(&lock)

      let context = UnsafePointer<T>(dispatch_get_context(ws))
      switch context
      {
      case nil:
        preconditionFailure(__FUNCTION__)

      default:
        let element = context.memory
        dispatch_set_context(ws, nil)
        dispatch_semaphore_signal(ws)
        return element
      }
    }

    if closed
