 
 import Darwin.Mach
 import Dispatch.time
+import Foundation.NSThread
 
 struct SemaphorePool
 {

final public class ChannelSemaphore
{
  private var svalue: Int32
  private let semp: semaphore_t

  private var currentState = ChannelSemaphoreState.Ready
  private var selected = 0

  private init(value: Int32)
  {
    svalue = (value > 0) ? value : 0
//    semp = {
//      var newport = semaphore_t()
//      let kr = semaphore_create(mach_task_self_, &newport, SYNC_POLICY_FIFO, 0)
//      assert(kr == KERN_SUCCESS, __FUNCTION__)
//      return newport
//    }()
  }

  private convenience init()
