Cannot get thread ID with Thread.getThis() in specific callback functions on Windows

Haruki Shigemori rayerd.wiz at gmail.com
Mon Dec 6 09:10:05 PST 2010


(2010/12/06 16:59), Denis Koroskin wrote:
> Because D runtime doesn't know about the newly created thread, and
> static constructors weren't called. Try calling the following in your
> callbacks:
>
> if (Thread.getThis() is null) thread_attachThis(); // if
> (dont_know_about_this_thread) initialize_it();

Wow... Is this D's design?
I want phobos or druntime to take care of this problem.
Is it difficult?


More information about the Digitalmars-d mailing list