[Issue 9641] Wrong module init order when a thread is created in a module ctor

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 18 07:06:16 PDT 2017


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

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to Martin Nowak from comment #1)
> I think the fix would need a mutex which blocks all created threads until
> all shared module constructors are finished. This might easily cause
> deadlocks though.

Sounds very similar to how Windows blocks threads created in DllMain. The
deadlock issue is there as well (threads will remain suspended until
initialization completes).

--


More information about the Digitalmars-d-bugs mailing list