File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1598,7 +1598,7 @@ SWIFT_CC(swift)
15981598static void swift_task_startOnMainActorImpl(AsyncTask* task) {
15991599 AsyncTask * originalTask = _swift_task_clearCurrent ();
16001600 ExecutorRef mainExecutor = swift_task_getMainExecutor ();
1601- if (swift_task_getCurrentExecutor () != swift_task_getMainExecutor ( ))
1601+ if (! swift_task_isCurrentExecutor (mainExecutor ))
16021602 swift_Concurrency_fatalError (0 , " Not on the main executor" );
16031603 swift_retain (task);
16041604 swift_job_run (task, mainExecutor);
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ extension Task where Failure == Error {
192192 @_spi ( MainActorUtilities)
193193 @MainActor
194194 @available ( SwiftStdlib 5 . 9 , * )
195+ @discardableResult
195196 public static func startOnMainActor(
196197 priority: TaskPriority ? = nil ,
197198 @_inheritActorContext @_implicitSelfCapture _ work: __owned @Sendable @escaping @MainActor ( ) async throws -> Success
@@ -213,6 +214,7 @@ extension Task where Failure == Never {
213214 @_spi ( MainActorUtilities)
214215 @MainActor
215216 @available ( SwiftStdlib 5 . 9 , * )
217+ @discardableResult
216218 public static func startOnMainActor(
217219 priority: TaskPriority ? = nil ,
218220 @_inheritActorContext @_implicitSelfCapture _ work: __owned @Sendable @escaping @MainActor ( ) async -> Success
You can’t perform that action at this time.
0 commit comments