     }
     else
     {
-      assert(closed, __FUNCTION__)
+      assert(closed != 0, __FUNCTION__)
       OSSpinLockUnlock(&rlock)
       filled.signal()
       return nil

  {
    // the `empty` semaphore has already been decremented for this operation.
    OSSpinLockLock(&wlock)
    if !closed && head+capacity > tail
    {
      buffer.advancedBy(tail&mask).initialize(newElement)
      tail = tail &+ 1


  deinit
  {
    while (tail &- head) > 0
    {
      buffer.advancedBy(head&mask).destroy()
      head = head &+ 1
