std.concurrency and module constructors
Steven Schveighoffer
schveiguy at yahoo.com
Fri May 11 05:33:26 PDT 2012
On Fri, 11 May 2012 07:34:46 -0400, japplegame <japplegame at gmail.com>
wrote:
> OS: Windows 7 64bit
> Compiler: DMD32 D Compiler v2.059
>
> Using spawn in module constructor causes very strange behavior.
>
> import std.concurrency;
> import std.stdio;
> void main() {
> }
> void worker() {
> receiveOnly!OwnerTerminated;
> }
> static this() {
> writeln("module constructor");
> spawn(&worker);
> }
> static ~this() {
> writeln("module destructor");
> }
>
> prints in console:
>
> module constructor
> module destructor
> module constructor
> module destructor
> module constructor
> module constructor
> module constructor
> module constructor
> module constructor
> ...
This list is for bugzilla to post to, it is not for general bug reports or
help requests. I really wish it was disabled to post to from everyone but
bugzilla.
Please repost your issue to D.learn.
Thanks
-Steve
More information about the Digitalmars-d-bugs
mailing list