Skip to content

[WebAssembly] Add SWIFT_ONCE_F implementation to Lazy.h #31674

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
May 13, 2020

Conversation

MaxDesiatov
Copy link
Contributor

SWIFT_ONCE_F has to be implemented separately for WebAssembly/WASI as WebAssembly currently doesn't support threads.

Related to SR-9307.

(cc @compnerd @kateinoigakukun)

@MaxDesiatov MaxDesiatov force-pushed the maxd/wasi-call-once branch from 0dff35d to 8e28d42 Compare May 9, 2020 16:06
@CodaFi
Copy link
Contributor

CodaFi commented May 9, 2020

My immediate concern is that we have documentation about how this implementation suffices but should be immediately replaced with one grounded in atomics when the WASM folk get around to merging support for concurrency.

Could you open an SR and leave behind a FIXME referencing that?

@MaxDesiatov
Copy link
Contributor Author

@CodaFi there's already a reference to the corresponding SR-12097 at the header of the file in master, couple of lines above, not captured by the GitHub PR diff, unfortunately. Would you like it to be duplicated at the #ifdef too?

@CodaFi
Copy link
Contributor

CodaFi commented May 9, 2020

I’d like a separate issue about this function specifically. The SR is OK as an umbrella, but there’s no signal in there about what is and isn’t done.

@MaxDesiatov MaxDesiatov force-pushed the maxd/wasi-call-once branch from 8e28d42 to b1f1838 Compare May 9, 2020 16:39
@MaxDesiatov
Copy link
Contributor Author

Makes sense, that's done now.

@CodaFi
Copy link
Contributor

CodaFi commented May 9, 2020

@swift-ci smoke test

@@ -24,6 +24,24 @@
#include "swift/Basic/Malloc.h"
#include "swift/Basic/type_traits.h"

#ifdef __wasi__
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind using #if define(__wasi__) please?

@MaxDesiatov MaxDesiatov force-pushed the maxd/wasi-call-once branch from b1f1838 to ec264a8 Compare May 10, 2020 09:36
@MaxDesiatov MaxDesiatov requested a review from compnerd May 10, 2020 09:37
@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8e28d429f7b3ec817dafe37a21a00d55392a4ebf

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 8e28d429f7b3ec817dafe37a21a00d55392a4ebf

@compnerd compnerd merged commit 4b9fca5 into swiftlang:master May 13, 2020
@MaxDesiatov MaxDesiatov deleted the maxd/wasi-call-once branch May 13, 2020 08:31
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.

5 participants