     self.capacity = (capacity < 1) ? 1 : min(capacity, 32768)
 
     filled = SChanSemaphore(value: 0)
-    empty =  SChanSemaphore(value: Int32(self.capacity))
+    empty =  SChanSemaphore(value: self.capacity)
 
     // find the next power of 2 that is >= self.capacity
     var v = self.capacity - 1


  final override func close()
  {
    if closed { return }

    OSSpinLockLock(&wlock)
    closed = true
    OSSpinLockUnlock(&wlock)

    filled.signal()
    empty.signal()
  }

  /**


  final override func put(newElement: T) -> Bool
  {
    if closed != 0 { return false }

    empty.wait()

    if closed == 0
    {
      let index = OSAtomicIncrementLongBarrier(&tail)
      buffer.advancedBy(index&mask).initialize(newElement)

      filled.signal()
      return true
    }
    else
    {
      empty.signal()
      return false
    }
