[phobos] Strange design of core.sync.condition in D
Michael Galuza
riddlermichael at gmail.com
Thu Sep 13 11:00:31 UTC 2018
Class core.sync.Mutex has shared and non-shared versions of its methods.
This is logical — mutex is shared between threads. But class
core.sync.Condition doesn't have shared methods at all. Why? Maybe I missed
something, but it's very strange for me, because such code doesn't work:
---class Foo { private Mutex mtx; private Condition cnd;
shared this() { mtx = new Mutex(this); // error: no constructor
Mutex(shared Object) cnd = new Condition(mtx); // error: no
constructor Condition(shared Mutex) }}---
Please enlighten me)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20180913/0f30dbeb/attachment.html>
More information about the phobos
mailing list