File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,12 @@ class TaskGroupBase : public TaskGroupTaskStatusRecord {
292
292
};
293
293
294
294
protected:
295
- #if SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY || SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL
295
+ // Guard with SWIFT_THREADING_NONE and not just SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY
296
+ // because the latter just means that the global executor is cooperative,
297
+ // but it doesn't mean that the target platform is always single-threaded. For example, on
298
+ // wasm32-unknown-wasip1-threads, the global executor is cooperative, but users can still set up their
299
+ // own TaskExecutor with multiple threads.
300
+ #if SWIFT_THREADING_NONE || SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL
296
301
// Synchronization is simple here. In a single threaded mode, all swift tasks
297
302
// run on a single thread so no coordination is needed. In a task-to-thread
298
303
// model, only the parent task which created the task group can
You can’t perform that action at this time.
0 commit comments