[Issue 17543] __gshared block modifier is ignored by static variables
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Jun 24 09:37:37 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17543
--- Comment #3 from Robert Luger <weltensturm at gmail.com> ---
This works though:
import std.stdio, std.parallelism;
__gshared:
auto return_gshared(){
class Test {
bool set;
}
return new Test();
}
void main(){
auto obj = return_gshared();
auto t = { obj.set = true; }.task;
t.executeInNewThread;
t.spinForce;
writeln(obj.set);
}
--
More information about the Digitalmars-d-bugs
mailing list