[Issue 3462] Add a clean way to exit a process.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 16 15:58:28 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=3462

--- Comment #8 from Sean Kelly <sean at invisibleduck.org> ---
That would work fine for a single-threaded program.  But when you call exit(0)
in a multithreaded program, all shared data is left in an undefined state. 
Mutexes might still be locked, etc.  So it isn't safe to do basically any
cleanup at that point without the risk of deadlock.  C gets around this problem
because multithreading is outside the scope of the language definition, but we
don't have that luxury.  If you simply want the program to halt without cleanup
though, that's much easier.

--


More information about the Digitalmars-d-bugs mailing list