Problems with Mutex

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 27 06:28:54 PDT 2014


On Mon, 27 Oct 2014 09:24:13 -0400
Steven Schveighoffer via Digitalmars-d-learn
<digitalmars-d-learn at 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.
that's due to difference betwen plain type and shared type.
`shared(Mutex)` is not the same as simply `Mutex`. to use class as
shared var you have to declare it as 'shared class'. or at least
declare some of class methods as 'shared'.

but for Mutex it's perfectly ok to use it as '__gshared' object.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141027/8be04f65/attachment.sig>


More information about the Digitalmars-d-learn mailing list