     static func createBlock(block: () -> Result, suspend: ((Result) -> Bool)?) -> (SDAtomic) -> Void {
         return { atomic in
             let _self = atomic as! SDTask<Result>
-            if _self._result == nil {
+            if let result = _self._result {
+                if suspend?(result) != true {
+                    _self._notify.forEach { $0(result) }
+                }
+                _self._notify = []
+            } else {
                 let result = block()
                 _self._lck.synchronized { _self._result = result }
                 dispatch_semaphore_signal(_self.sem)
                 _self.signal()
-            } else {
-                if suspend == nil || !suspend!(_self._result!) {
-                    _self._notify.forEach { $0.signal() }
-                }
-                _self._notify = []
             }
         }
     }

    
    /// Run `block` after `self` is completed with specific queue.
    public final func then<R>(queue: dispatch_queue_t, _ block: (Result) -> R) -> SDTask<R> {
        let task = SDTask<R>(queue: queue, suspend: nil) { block(self.result) }
        return _lck.synchronized {
            if _result == nil {
                _notify.append(task)
            } else {
                task.signal()
            }
            return task

    
    private let sem: dispatch_semaphore_t = dispatch_semaphore_create(0)
    
    private var _notify: [(Result) -> Void] = []
    
    private var _lck: SDSpinLock = SDSpinLock()
    private var _result: Result?
