     /// 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()

    private let session: Session
    
    private var resumeData: NSData? = nil
    private var completed: Int32 = 0
    private let condition: NSCondition
    private var ticked = false
    
