how to use shared keyword in 2.063 version?

Andrey vangelisforever at yandex.ru
Sat Jun 1 01:03:28 PDT 2013


On Saturday, 1 June 2013 at 00:58:00 UTC, Jonathan M Davis wrote:
> On Friday, May 31, 2013 23:26:19 Anthony Goins wrote:
>> To create a shared object you need shared this ctor.
>> 
>> immutable this() for immutable,
>> 
>> and const this() for const.
>> 
>> Check out the change log. #2 on the list.
>
> Either that or you create it as thread-local and cast to shared.
>
> - Jonathan M Davis

Does it mean, that to create shared Mutex or shared Socket for 
example, I have to use next construction:

	shared Socket socket = cast(shared Mutex)(new Socket());

	shared Mutex m = cast(shared Mutex)(new Mutex());

??


More information about the Digitalmars-d-learn mailing list