We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 45e210b + 4f740a4 commit 62f9050Copy full SHA for 62f9050
stdlib/public/Concurrency/Task.cpp
@@ -536,6 +536,12 @@ void swift::swift_continuation_logFailedCheck(const char *message) {
536
}
537
538
void swift::swift_task_asyncMainDrainQueue() {
539
+#if SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR
540
+ bool Finished = false;
541
+ donateThreadToGlobalExecutorUntil([](void *context) {
542
+ return *reinterpret_cast<bool*>(context);
543
+ }, &Finished);
544
+#else
545
#if defined(_WIN32)
546
static void(FAR *pfndispatch_main)(void) = NULL;
547
@@ -561,4 +567,5 @@ void swift::swift_task_asyncMainDrainQueue() {
561
567
else
562
568
dispatch_main();
563
569
#endif
570
+#endif
564
571
0 commit comments