[D-runtime] What's with core.sync.condition usage?
Alex Rønne Petersen
xtzgzorex at gmail.com
Thu Apr 26 16:10:52 PDT 2012
Now I'm really confused.
How is this thing *actually* supposed to be used? And can we add some
examples to the docs?
Regards,
Alex
On Fri, Apr 27, 2012 at 1:08 AM, Sean Kelly <sean at invisibleduck.org> wrote:
> On Apr 26, 2012, at 1:22 PM, Steve Schveighoffer wrote:
> >
> > From: Sean Kelly <sean at invisibleduck.org>
> > void put(T val) {
> > synchronized (cond.mutex) {
> > queue.pushBack(val);
> > cond.notify(); // atomically unlocks mutex on call, locks on
> return
> > }
> > }
> > Huh, I thought notify did not unlock the mutex at all (I don't see why
> it would need to).
>
> Oops… you're right. The original implementation (Hoare's) did, I believe,
> but the modern one does not.
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d-runtime/attachments/20120427/8c157d32/attachment.html>
More information about the D-runtime
mailing list