 
       dispatch_set_context(threadLock, waitSelect)
       self.writerQueue.enqueue(threadLock)
+      cancelable = true
       OSSpinLockUnlock(&self.lock)
       dispatch_semaphore_wait(threadLock, DISPATCH_TIME_FOREVER)
 
       // got awoken
-      let context = dispatch_get_context(threadLock)
-
-      switch context
+      switch dispatch_get_context(threadLock)
       {
       case nil:
         // thread was awoken by close(): write operation fails

      case waitSelect:
        let threadLock = SemaphorePool.dequeue()
        dispatch_set_context(threadLock, &newElement)
        let contextptr = UnsafeMutablePointer<Void>(Unmanaged.passRetained(threadLock).toOpaque())
        dispatch_set_context(rs, contextptr)
        dispatch_semaphore_signal(rs)
        dispatch_semaphore_wait(threadLock, DISPATCH_TIME_FOREVER)

        let context = dispatch_get_context(threadLock)
        dispatch_set_context(threadLock, nil)
        SemaphorePool.enqueue(threadLock)


  override func selectPut(semaphore: SemaphoreChan, selectionID: Selectable) -> Signal
  {
    let threadLock = SemaphorePool.dequeue()
    var cancelable = false

    dispatch_async(dispatch_get_global_queue(qos_class_self(), 0)) {
      _ in
