Skip to content

Concurrency: Avoid importing Dispatch with no global executor #37059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Apr 25, 2021

Dispatch is not available on platforms where SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR is defined as 0, e.g. WebAssembly/WASI.

CC @kateinoigakukun

Dispatch is not available on platforms where `SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR` is defined, e.g. WASI.
@MaxDesiatov
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not #ifndef?

Change overall LGTM

@MaxDesiatov
Copy link
Contributor Author

#ifndef would miss the case when SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR is substituted with 0. It seems to be always defined as either 0 or 1 here: https://github.com/apple/swift/blob/7611ecca2b5b2ae8803b9bc4e7ca9ff335667c86/stdlib/public/Concurrency/TaskPrivate.h#L66

@MaxDesiatov MaxDesiatov merged commit d9ef216 into main Apr 26, 2021
@MaxDesiatov MaxDesiatov deleted the maxd/actor-dispatch-ifdef branch April 26, 2021 11:10
kateinoigakukun pushed a commit to swiftwasm/swift that referenced this pull request Apr 27, 2021
…ang#37059)

Dispatch is not available on platforms where `SWIFT_CONCURRENCY_COOPERATIVE_GLOBAL_EXECUTOR` is defined `0`, e.g. WebAssembly/WASI..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants