https://issues.dlang.org/show_bug.cgi?id=20680
Sebastiaan Koppe <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] OS|Windows |All --- Comment #1 from Sebastiaan Koppe <[email protected]> --- This is the case as well under Linux. With GDB attached I have put a breakpoint at the core.thread.osthread.Thread's destructor and confirmed it doesn't get run (I spawned 100k threads and let them run till finish). As a workaround I am calling `pthread_detach(pthread_self);` right before the thread terminates. This is not a good solution though since the Thread's destructor (if it did ran), would also call pthread_detach, which results in undefined behaviour. Better would be to do a thread_detachThis as well, since that will cause a different branch in the Thread's destructor and avoid the call to pthread_detach. Sadly, using thread_detachThis and the pthread_detach I get spurious crashes in std.concurrency's tls module teardown (sometimes). --
