                 sema.signal()
             }
         }
+    }
+    
+    deinit {
+        _wake.close()
+        _caller.close()
     }
     
     public func semaphore() -> SemaphoreType {

    
    private let _loop:Loop
    private let _wake:Async
    private let _semaphore:SemaphoreType
    
    init() {

    
    /// returns true if timed out, false otherwise
    public func run(until:NSDate, once:Bool) -> Bool {
        //yes, fail if so. It's runtime error
        try! _caller.start()
        defer {
            //yes, fail if so. It's runtime error
            try! _caller.stop()
        }
        
        let mode = once ? UV_RUN_ONCE : UV_RUN_DEFAULT
        var timedout:Bool = false
        //yes, fail if so. It's runtime error
