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)
1598
1598
static void swift_task_startOnMainActorImpl(AsyncTask* task) {
1599
1599
AsyncTask * originalTask = _swift_task_clearCurrent ();
1600
1600
ExecutorRef mainExecutor = swift_task_getMainExecutor ();
1601
- if (swift_task_getCurrentExecutor () != swift_task_getMainExecutor ( ))
1601
+ if (! swift_task_isCurrentExecutor (mainExecutor ))
1602
1602
swift_Concurrency_fatalError (0 , " Not on the main executor" );
1603
1603
swift_retain (task);
1604
1604
swift_job_run (task, mainExecutor);
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ extension Task where Failure == Error {
192
192
@_spi ( MainActorUtilities)
193
193
@MainActor
194
194
@available ( SwiftStdlib 5 . 9 , * )
195
+ @discardableResult
195
196
public static func startOnMainActor(
196
197
priority: TaskPriority ? = nil ,
197
198
@_inheritActorContext @_implicitSelfCapture _ work: __owned @Sendable @escaping @MainActor ( ) async throws -> Success
@@ -213,6 +214,7 @@ extension Task where Failure == Never {
213
214
@_spi ( MainActorUtilities)
214
215
@MainActor
215
216
@available ( SwiftStdlib 5 . 9 , * )
217
+ @discardableResult
216
218
public static func startOnMainActor(
217
219
priority: TaskPriority ? = nil ,
218
220
@_inheritActorContext @_implicitSelfCapture _ work: __owned @Sendable @escaping @MainActor ( ) async -> Success
You can’t perform that action at this time.
0 commit comments