We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Transfered from https://issues.dlang.org/show_bug.cgi?id=24736 from dlang/phobos#9876
Description
import core.atomic; // Compile with -preview=all enum VARS_AFTER_FP = true; synchronized shared class A { static void proc() {} void fn(ARGS...)(ARGS args) { static struct S { static if (VARS_AFTER_FP) { void function() fp; ARGS vars; } else { ARGS vars; void function() fp; } } S s; s.fp.atomicStore(&proc); static foreach (i, e; args) { s.vars[i].atomicStore(e.atomicLoad()); } } } void main() { auto a = new A; a.fn(1); // OK a.fn(2, "str"); // Runtime error when VARS_AFTER_FP is false. a.fn("str", 3); // Runtime error when VARS_AFTER_FP is true. }
The text was updated successfully, but these errors were encountered:
atomicStore
No branches or pull requests
Transfered from https://issues.dlang.org/show_bug.cgi?id=24736 from dlang/phobos#9876
Description
The text was updated successfully, but these errors were encountered: