Are spawn'ed threads waited automatically?

Steven Schveighoffer schveiguy at yahoo.com
Mon Jun 6 12:07:02 PDT 2011


On Mon, 06 Jun 2011 14:09:25 -0400, Ali Çehreli <acehreli at yahoo.com> wrote:

> First, the answer may be as simple as "use core.thread.thread_joinAll".  
> Is that the proper way of waiting for all threads?

main (the C main, not D main) does this already:

https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L512

But note that "daemonized" threads will not be included:

http://www.digitalmars.com/d/2.0/phobos/core_thread.html#isDaemon

-Steve


More information about the Digitalmars-d-learn mailing list