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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 30 11:32:59 PDT 2012


On 5/30/12 10:47 AM, Steven Schveighoffer wrote:
> Yes, you can just use a private mutex. But doesn't that just lead to
> recommending not using a feature of the language?

I don't think so. Synchronized classes are the unit of scoped locking in 
D. If you want to do all scoped locking internally, make the class private.

> Besides, I really like
> the synchronized block keyword thing. It's a great mechanism for locking.

Me too!


Andrei


More information about the Digitalmars-d mailing list