     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 var isFull: Bool
  {
      return (tail &- head) >= capacity
  }

  /**
    Determine whether the channel has been closed
  */

  final override var isClosed: Bool { return closed }

  // MARK: ChannelType methods



  final override func close()
  {
    if OSAtomicCompareAndSwapLongBarrier(0, 1, &closed)
    {
      filled.signal()
      empty.signal()
    }
  }

  /**
