     /// Test whether response is ready to use.
     /// This function *Never* block
     public func isReady() -> Bool {
-        self.condition.lock()
-        defer {
-            self.condition.unlock()
-        }
-        return self.completed
+        return OSAtomicCompareAndSwap32(1, 1, &self.completed)
     }
     
     /// Suspend the ongoing task.

    }
    
    private func waitForComplete() {
        self.condition.lock()
        while !self.completed {
            self.condition.wait()
        }
        self.condition.unlock()

    }
    
    func markCompleted() {
        OSAtomicCompareAndSwap32(0, 1, &self.completed)
        self.condition.broadcast()
    }
    
