       dispatch_semaphore_wait(threadLock, DISPATCH_TIME_FOREVER)
 
       // got awoken
-      let context = UnsafeMutablePointer<T>(dispatch_get_context(threadLock))
+      let context = dispatch_get_context(threadLock)
 
       switch context
       {

          OSSpinLockUnlock(&self.lock)
          
          let context = UnsafePointer<T>(dispatch_get_context(ws))
          if context == nil
          { // not a normal code path.
            assert(false, __FUNCTION__)
            // dispatch_semaphore_signal(nil)
            return
          }
          let element = context.memory
          dispatch_set_context(ws, nil)
          dispatch_semaphore_signal(ws)

          let selection = Selection(selectionID: selectionID, selectionData: element)
          let selectptr = UnsafeMutablePointer<Void>(Unmanaged.passRetained(selection).toOpaque())
          dispatch_set_context(s, selectptr)
          dispatch_semaphore_signal(s)
          return
        }
        else
        {

      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 Selection(selectionID: selectionID, selectionData: element)
      }
    }
    OSSpinLockUnlock(&lock)
    return nil
