[Issue 4307] New: spawn()'ed thread doesn't terminate

Sean Kelly sean at invisibleduck.org
Tue Jun 15 08:50:19 PDT 2010


The main thread is somewhat special in D--it doesn't actually terminate until all other threads have terminated.  And because the "OwnerTerminated" message is sent in a static dtor, the ordering is wrong for having spawned threads receive this message.  I'll leave it up to Andrei to decide whether this is correct behavior or if the OwnerTerminated message should be sent when D main() exits (I'm leaning towards this latter behavior myself).  If a change is necessary I'll have to add a stack for onMainExit callbacks to be executed in druntime.


More information about the Digitalmars-d-bugs mailing list