         self.willAccessValue()
         defer {
             self.didAccessValue()
-            self.finishOperation()
+            
+            self.finishOperation()
+            
+            if let progress = self._progress {
+                progress.completedUnitCount = progress.totalUnitCount
+            }
         }
         
         guard self.value == nil && self.error == nil else { return }

    public override final func waitUntilFinished() {
        assert(!NSThread.isMainThread(), "Cannot wait task on main thread.")
        super.waitUntilFinished()
    }

    // MARK: -

            closure(self)
        }
    }
    
    @available(*, unavailable)
    public override func cancel() {
        super.cancel()
    }

}


// MARK: -

private final class TaskProgress: NSProgress {
    
    private unowned let task: TaskType
    
    private init(task: TaskType) {
        self.task = task
        super.init(parent: nil, userInfo: nil)
        
        self.totalUnitCount = 1
        self.cancellable = self.task is CancellableTaskType
    }
    
    //
    private override var cancellationHandler: (() -> Void)? {
        get {
            if let cancellableTask = self.task as? CancellableTaskType {
                return cancellableTask.cancellationHandler
            }
            else {
                return super.cancellationHandler
            }
        }
        set {
            if let cancellableTask = self.task as? CancellableTaskType {
                cancellableTask.cancellationHandler = newValue
            }
            else {
                super.cancellationHandler = newValue
            }
        }
    }
    
    private override func cancel() {
        super.cancel()
        
        if let cancellableTask = self.task as? CancellableTaskType {
            cancellableTask.cancel()
        }
    }
    
}

