             return
         }
         else if let workItem = self.workItem {
+            Thread.current.cancellableTaskBox?.value?.cancellation += { [weak self] in
+                (self as? CancellableTask)?.cancel()
+            }
+
             queue.async(execute: workItem)
         }
         else {

        }
        else if let workItem = self.workItem {
            workItem.wait()
            waitDispatchGroupIfNeeded()

            guard let result = self.result else {
                fatalError()

        }
    }

    private func waitDispatchGroup() {
        var dispatchGroup: DispatchGroup?

        do {
