[Issue 16057] [TDPL] synchronized (a, b) compiles and runs with wrong semantics

2020-09-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16057

mhh  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||maxha...@gmail.com
 Resolution|--- |FIXED

--- Comment #3 from mhh  ---
Since around dmd ~2.078, one cannot use the comma operator at all so this
particular construct is no longer an issue

See https://run.dlang.io/is/EL9foO

--


[Issue 16057] [TDPL] synchronized (a, b) compiles and runs with wrong semantics

2018-01-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16057

yebblies  changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com

--- Comment #2 from yebblies  ---
*** Issue 18277 has been marked as a duplicate of this issue. ***

--


[Issue 16057] [TDPL] synchronized (a, b) compiles and runs with wrong semantics

2016-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16057

ZombineDev  changed:

   What|Removed |Added

   Keywords||safe
 CC||petar.p.ki...@gmail.com

--


[Issue 16057] [TDPL] synchronized (a, b) compiles and runs with wrong semantics

2016-05-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16057

--- Comment #1 from Andrei Alexandrescu  ---
Test code (thanks Steve Schveighoffer) should not print "oops!" but does:


import std.concurrency;
import core.sync.mutex;
import core.thread;
import std.stdio;

__gshared Mutex a;
__gshared Mutex b;

shared static this()
{
a = new Mutex;
b = new Mutex;
}

void badThread()
{
synchronized(a)
{
writeln("a is locked!");
while(1) { Thread.sleep(1.seconds); }
}
}

void main()
{
spawn();
Thread.sleep(1.seconds);
synchronized(a, b)
{
writeln("oops!");
}
}

--