File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -537,7 +537,7 @@ void swift_continuation_logFailedCheck(const char *message);
537
537
// / If the binary links CoreFoundation, uses CFRunLoopRun
538
538
// / Otherwise it uses dispatchMain.
539
539
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
540
- void swift_task_asyncMainDrainQueue ();
540
+ void swift_task_asyncMainDrainQueue [[noreturn]] ();
541
541
542
542
// / Establish that the current thread is running as the given
543
543
// / executor, then run a job.
Original file line number Diff line number Diff line change @@ -828,6 +828,7 @@ void swift::swift_task_asyncMainDrainQueue() {
828
828
abort ();
829
829
830
830
pfndispatch_main ();
831
+ exit (0 );
831
832
#else
832
833
// CFRunLoop is not available on non-Darwin targets. Foundation has an
833
834
// implementation, but CoreFoundation is not meant to be exposed. We can only
@@ -836,8 +837,10 @@ void swift::swift_task_asyncMainDrainQueue() {
836
837
#if defined(__APPLE__)
837
838
auto runLoop =
838
839
reinterpret_cast <void (*)(void )>(dlsym (RTLD_DEFAULT, " CFRunLoopRun" ));
839
- if (runLoop)
840
- return runLoop ();
840
+ if (runLoop) {
841
+ runLoop ();
842
+ exit (0 );
843
+ }
841
844
#endif
842
845
843
846
dispatch_main ();
You can’t perform that action at this time.
0 commit comments