[D-runtime] What's with core.sync.condition usage?

Jonathan M Davis jmdavisProg at gmx.com
Wed Apr 25 16:17:27 PDT 2012


On Thursday, April 26, 2012 00:41:40 Alex Rønne Petersen wrote:
> Hi,
> 
> What's with the weird, convoluted way one is supposed to use
> core.sync.condition.Condition? Having to lock on a mutex while using a
> Condition object is extremely weird compared to APIs in other
> programming languages. Any particular reason behind this design?

Really? In C++, from what I've seen, you always end up locking on a mutex to 
protect a condition variable. How could it work _without_ locking? The 
condition variable wouldn't be protected against multiple threads using it.

- Jonathan M Davis


More information about the D-runtime mailing list