From: Alex Rønne Petersen <xtzgzorex@gmail.com>
To: D's runtime library developers list <d-runtime@puremagic.com>
Sent: Wednesday, April 25, 2012 8:18 PM
Subject: Re: [D-runtime] What's with core.sync.condition usage?
Surely it could lock whatever it needs to lock internally?
See:
http://msdn.microsoft.com/en-us/library/system.threading.autoresetevent.aspxThat class is entirely thread safe.
Regards,
Alex
On Thu, Apr 26, 2012 at 1:17 AM, Jonathan M Davis <
jmdavisProg@gmx.com> wrote:
> 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
> _______________________________________________
> D-runtime mailing list
>
D-runtime@puremagic.com>
http://lists.puremagic.com/mailman/listinfo/d-runtime_______________________________________________
D-runtime mailing list
D-runtime@puremagic.comhttp://lists.puremagic.com/mailman/listinfo/d-runtime