synchronized (this[.classinfo]) in druntime and phobos

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 30 12:48:47 PDT 2012


To clarify:

On 5/30/12 12:25 PM, Alex Rønne Petersen wrote:
>  The mutex may not be
> directly exposed in the sense that you can obtain a reference (though in
> reality in all compiler implementations, you can), but it is exposed in
> the sense that you can lock and unlock it, which is a mutation of state
> and program flow.

synchronized (object) {
     writeln("about to unlock the object");
     XXX
     writeln("unlocked the object");
}

Replace "XXX" with a construct that unlocks the object.


Andrei


More information about the Digitalmars-d mailing list