Skip to content

Commit 1ed3425

Browse files
committed
Fixes for this branch
1 parent 218136c commit 1ed3425

File tree

3 files changed

+5
-94
lines changed

3 files changed

+5
-94
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,6 @@ extension Task where Failure == Never {
445445
// Create the asynchronous task future.
446446
let (task, _) = Builtin.createAsyncTaskFuture(Int(flags.bits), operation)
447447

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-
457448
// Enqueue the resulting job.
458449
_enqueueJobGlobal(Builtin.convertTaskToJob(task))
459450

@@ -490,15 +481,6 @@ extension Task where Failure == Error {
490481
// Create the asynchronous task future.
491482
let (task, _) = Builtin.createAsyncTaskFuture(Int(flags.bits), operation)
492483

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-
502484
// Enqueue the resulting job.
503485
_enqueueJobGlobal(Builtin.convertTaskToJob(task))
504486

@@ -746,16 +728,6 @@ public struct UnsafeCurrentTask {
746728
self._task = task
747729
}
748730

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-
759731
/// A Boolean value that indicates whether the current task was canceled.
760732
///
761733
/// After the value of this property is `true`, it remains `true` indefinitely.
@@ -861,15 +833,15 @@ public func _runChildTask<T>(
861833
let currentTask = Builtin.getCurrentAsyncTask()
862834

863835
// Set up the job flags for a new task.
864-
var flags = Task.JobFlags()
836+
var flags = JobFlags()
865837
flags.kind = .task
866838
flags.priority = getJobFlags(currentTask).priority ?? .unspecified
867839
flags.isFuture = true
868840
flags.isChildTask = true
869841

870842
// Create the asynchronous task future.
871843
let (task, _) = Builtin.createAsyncTaskFuture(
872-
flags.bits, operation)
844+
Int(flags.bits), operation)
873845

874846
// Enqueue the resulting job.
875847
_enqueueJobGlobal(Builtin.convertTaskToJob(task))

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public struct TaskGroup<ChildTaskResult> {
296296

297297
// Create the asynchronous task future.
298298
let (childTask, _) = Builtin.createAsyncTaskGroupFuture(
299-
flags.bits, _group, operation)
299+
Int(flags.bits), _group, operation)
300300

301301
// Attach it to the group's task record in the current task.
302302
_ = _taskGroupAttachChild(group: _group, child: childTask)
@@ -486,7 +486,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
486486

487487
// Create the asynchronous task future.
488488
let (childTask, _) = Builtin.createAsyncTaskGroupFuture(
489-
flags.bits, _group, operation)
489+
Int(flags.bits), _group, operation)
490490

491491
// Attach it to the group's task record in the current task.
492492
_ = _taskGroupAttachChild(group: _group, child: childTask)
@@ -531,7 +531,7 @@ public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
531531

532532
// Create the asynchronous task future.
533533
let (childTask, _) = Builtin.createAsyncTaskGroupFuture(
534-
flags.bits, _group, operation)
534+
Int(flags.bits), _group, operation)
535535

536536
// Attach it to the group's task record in the current task.
537537
_ = _taskGroupAttachChild(group: _group, child: childTask)

test/Concurrency/Runtime/async_task_equals_hashCode.swift

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)