1313import Swift
1414@_implementationOnly import SwiftConcurrencyInternalShims
1515
16- // ==== Task.startSynchronously ------------------------------------------------
16+ // ==== Task.immediate --------- ------------------------------------------------
1717
1818% METHOD_VARIANTS = [
1919% 'THROWING',
@@ -56,11 +56,11 @@ extension Task where Failure == ${FAILURE_TYPE} {
5656 /// - Returns: A reference to the unstructured task which may be awaited on.
5757 @available(SwiftStdlib 6.2, *)
5858 @discardableResult
59- public static func startSynchronously (
59+ public static func immediate (
6060 name: String? = nil,
6161 priority: TaskPriority? = nil,
6262 % # NOTE: This closure cannot be 'sending' because we'll trigger ' pattern that the region based isolation checker does not understand how to check'
63- % # In this case: `func syncOnMyGlobalActor() { Task.startSynchronously { @MyGlobalActor in } }`
63+ % # In this case: `func syncOnMyGlobalActor() { Task.immediate { @MyGlobalActor in } }`
6464 @_implicitSelfCapture _ operation: __owned @isolated(any) @escaping () async throws -> Success
6565 ) -> Task<Success, ${FAILURE_TYPE}> {
6666
@@ -109,7 +109,7 @@ extension Task where Failure == ${FAILURE_TYPE} {
109109 }
110110
111111 if canRunSynchronously {
112- _startTaskSynchronously (task!, targetExecutor: builtinSerialExecutor)
112+ _startTaskImmediately (task!, targetExecutor: builtinSerialExecutor)
113113 }
114114 return Task<Success, ${FAILURE_TYPE}>(task!)
115115 }
@@ -121,35 +121,35 @@ GROUP_AND_OP_INFO = [
121121 (
122122 'TaskGroup',
123123 [
124- 'startTaskSynchronously ',
125- 'startTaskSynchronouslyUnlessCancelled '
124+ 'addImmediateTask ',
125+ 'addImmediateTaskUnlessCancelled '
126126 ],
127127 '',
128128 'ChildTaskResult'
129129 ),
130130 (
131131 'ThrowingTaskGroup',
132132 [
133- 'startTaskSynchronously ',
134- 'startTaskSynchronouslyUnlessCancelled '
133+ 'addImmediateTask ',
134+ 'addImmediateTaskUnlessCancelled '
135135 ],
136136 'throws ',
137137 'ChildTaskResult'
138138 ),
139139 (
140140 'DiscardingTaskGroup',
141141 [
142- 'startTaskSynchronously ',
143- 'startTaskSynchronouslyUnlessCancelled '
142+ 'addImmediateTask ',
143+ 'addImmediateTaskUnlessCancelled '
144144 ],
145145 '',
146146 'Void'
147147 ),
148148 (
149149 'ThrowingDiscardingTaskGroup',
150150 [
151- 'startTaskSynchronously ',
152- 'startTaskSynchronouslyUnlessCancelled '
151+ 'addImmediateTask ',
152+ 'addImmediateTaskUnlessCancelled '
153153 ],
154154 'throws ',
155155 'Void'
@@ -204,7 +204,7 @@ extension ${GROUP_TYPE} {
204204 taskGroup: self._group,
205205 operation: operation
206206 )
207- _startTaskSynchronously (task, targetExecutor: builtinSerialExecutor)
207+ _startTaskImmediately (task, targetExecutor: builtinSerialExecutor)
208208 }
209209}
210210% end # METHOD_NAMES
@@ -264,5 +264,5 @@ extension Task where Failure == ${FAILURE_TYPE} {
264264@_silgen_name("swift_task_startOnMainActor")
265265internal func _startTaskOnMainActor(_ task: Builtin.NativeObject)
266266
267- @_silgen_name("swift_task_startSynchronously ")
268- internal func _startTaskSynchronously (_ task: Builtin.NativeObject, targetExecutor: Builtin.Executor?)
267+ @_silgen_name("swift_task_immediate ")
268+ internal func _startTaskImmediately (_ task: Builtin.NativeObject, targetExecutor: Builtin.Executor?)
0 commit comments