On Mon, 27 Oct 2014 09:24:13 -0400 Steven Schveighoffer via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> Just as a followup, for some reason Mutex is not callable as a shared > object, so you have to make it __gshared. > > This is unfortunate, but it is the only way to do it right now. > Because an actual mutex is thread safe, it is not a problem. p.s. generally you have to write code that can be used with shared vars with special accuracy. that's why D made a clear distinction between shared and thread variables and classes. you must explicitly declare your intention to use something as shared. generally this increases code safety and allows to writte better code. this can be somewhat unusual for those who used to use C/C++ before, as there is no such "guards" though.
signature.asc
Description: PGP signature