Re: Threads and OwnerTerminated

2011-11-17 Thread Jonathan M Davis
On Thursday, November 17, 2011 11:56 Andrej Mitrovic wrote: > This is an example from TDPL: > > import std.concurrency; > import std.exception; > import std.stdio; > > void main() > { > auto low = 0; > auto high = 100; > auto tid = spawn(&writer); > > foreach (i; low .. high) > { > writeln("Main

Re: Threads and OwnerTerminated

2011-11-17 Thread Andrej Mitrovic
Ah, I should have read the following parts where it describes thread termination, in TDPL. Woops. On 11/17/11, Andrej Mitrovic wrote: > This is an example from TDPL: > > import std.concurrency; > import std.exception; > import std.stdio; > > void main() > { > auto low = 0; > auto high = 1

Threads and OwnerTerminated

2011-11-17 Thread Andrej Mitrovic
This is an example from TDPL: import std.concurrency; import std.exception; import std.stdio; void main() { auto low = 0; auto high = 100; auto tid = spawn(&writer); foreach (i; low .. high) { writeln("Main thread: ", i); tid.send(thisTid, i); enforce(