can't understand why code do not working

Cliff via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 22 13:37:42 PDT 2014


On Monday, 22 September 2014 at 20:12:28 UTC, Suliman wrote:
> void worker()
> {
>     int value = 0;
>     while (value <=10)
>     {
>
>         value = receiveOnly!int();
>         writeln(value);
>         int result = value * 3;
>         ownerTid.send(result);
>     }
> }
>
> give me:
>
> Running .\app1.exe
> 2
> 6
> 3
> 9
> 4
> 12
> 5
> 15
> 6
> 18
> std.concurrency.OwnerTerminated at std\concurrency.d(234): Owner 
> terminated
> ----------------
> 0x00405777 in pure @safe void 
> std.concurrency.receiveOnly!(int).receiveOnly().__
> lambda3(std.concurrency.OwnerTerminated) at 
> C:\DMD\dmd2\windows\bin\..\..\src\ph
> obos\std\concurrency.d(730)
> 0x0040B88D in @safe void std.concurrency.Message.map!(pure 
> @safe void function(s
> td.concurrency.OwnerTerminated)*).map(pure @safe void 
> function(std.concurrency.O
> wnerTerminated)*) at 
> C:\DMD\dmd2\windows\bin\..\..\src\phobos\std\concurrency.d(
> 158)
> 0x0040B0B6 in 
> D3std11concurrency10MessageBox151__T3getTDFNbNfiZvTPFNaNfC3std11co
> ncurrency14LinkTerminatedZvTP8047E12172B30CAF110369CD57C78A37 
> at C:\DMD\dmd2\win
> dows\bin\..\..\src\phobos\std\concurrency.d(1159)

Is stdout threadsafe?


More information about the Digitalmars-d-learn mailing list