         let s = buffer.advancedBy(cursor).move()
         OSSpinLockUnlock(&lock)
         s.svalue = 0
+        s.iptr = nil
         s.currentState = ChannelSemaphoreState.Ready.rawValue
         return s
       }

          buffer[i] = buffer.advancedBy(cursor).move()
          OSSpinLockUnlock(&lock)
          s.svalue = 0
          s.currentState = ChannelSemaphoreState.Ready.rawValue
          return s
        }

//  Copyright (c) 2015 Guillaume Lessard. All rights reserved.
//

import Darwin.Mach.task
import Darwin.Mach.semaphore
import Darwin.Mach.mach_time
import Darwin.libkern.OSAtomic
import Dispatch.time
import Foundation.NSThread

