Skip to content

Commit 94bb1e8

Browse files
authored
Avoid using dispatch in Task.cpp
1 parent 0d7acb2 commit 94bb1e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/public/Concurrency/Task.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#include "TaskPrivate.h"
2323
#include "AsyncCall.h"
2424

25+
#if !SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR
2526
#include <dispatch/dispatch.h>
27+
#endif
2628

2729
#if !defined(_WIN32)
2830
#include <dlfcn.h>
@@ -536,7 +538,7 @@ void swift::swift_continuation_logFailedCheck(const char *message) {
536538
}
537539

538540
void swift::swift_task_asyncMainDrainQueue() {
539-
#if !defined(_WIN32)
541+
#if !defined(_WIN32) && !defined(__wasi__)
540542
auto runLoop =
541543
reinterpret_cast<void (*)(void)>(dlsym(RTLD_DEFAULT, "CFRunLoopRun"));
542544
if (runLoop)

0 commit comments

Comments
 (0)