@@ -445,15 +445,6 @@ extension Task where Failure == Never {
445
445
// Create the asynchronous task future.
446
446
let ( task, _) = Builtin . createAsyncTaskFuture ( Int ( flags. bits) , operation)
447
447
448
- // Copy all task locals to the newly created task.
449
- // We must copy them rather than point to the current task since the new task
450
- // is not structured and may out-live the current task.
451
- //
452
- // WARNING: This MUST be done BEFORE we enqueue the task,
453
- // because it acts as-if it was running inside the task and thus does not
454
- // take any extra steps to synchronize the task-local operations.
455
- _taskLocalsCopy ( to: task)
456
-
457
448
// Enqueue the resulting job.
458
449
_enqueueJobGlobal ( Builtin . convertTaskToJob ( task) )
459
450
@@ -490,15 +481,6 @@ extension Task where Failure == Error {
490
481
// Create the asynchronous task future.
491
482
let ( task, _) = Builtin . createAsyncTaskFuture ( Int ( flags. bits) , operation)
492
483
493
- // Copy all task locals to the newly created task.
494
- // We must copy them rather than point to the current task since the new task
495
- // is not structured and may out-live the current task.
496
- //
497
- // WARNING: This MUST be done BEFORE we enqueue the task,
498
- // because it acts as-if it was running inside the task and thus does not
499
- // take any extra steps to synchronize the task-local operations.
500
- _taskLocalsCopy ( to: task)
501
-
502
484
// Enqueue the resulting job.
503
485
_enqueueJobGlobal ( Builtin . convertTaskToJob ( task) )
504
486
@@ -746,16 +728,6 @@ public struct UnsafeCurrentTask {
746
728
self . _task = task
747
729
}
748
730
749
- /// The current task,
750
- /// represented in a way that's safe to store for later use.
751
- ///
752
- /// Operations on an instance of `Task` are safe to call from any other task,
753
- /// unlike `UnsafeCurrentTask`.
754
- @available ( * , deprecated, message: " Storing `Task` instances has been deprecated and will be removed soon. " )
755
- public var task : Task {
756
- Task ( _task)
757
- }
758
-
759
731
/// A Boolean value that indicates whether the current task was canceled.
760
732
///
761
733
/// After the value of this property is `true`, it remains `true` indefinitely.
@@ -861,15 +833,15 @@ public func _runChildTask<T>(
861
833
let currentTask = Builtin . getCurrentAsyncTask ( )
862
834
863
835
// Set up the job flags for a new task.
864
- var flags = Task . JobFlags ( )
836
+ var flags = JobFlags ( )
865
837
flags. kind = . task
866
838
flags. priority = getJobFlags ( currentTask) . priority ?? . unspecified
867
839
flags. isFuture = true
868
840
flags. isChildTask = true
869
841
870
842
// Create the asynchronous task future.
871
843
let ( task, _) = Builtin . createAsyncTaskFuture (
872
- flags. bits, operation)
844
+ Int ( flags. bits) , operation)
873
845
874
846
// Enqueue the resulting job.
875
847
_enqueueJobGlobal ( Builtin . convertTaskToJob ( task) )
0 commit comments