NOTE:
This routine does not run thread-local static constructors when called. If full functionality as a D thread is desired, the following function must be called after thread_attachThis:
extern (C) void rt_moduleTlsCtor();
thread_detachThis has a similar note about calling rt_moduleTlsDtor after thread_detachThis.
This prevents bugs like the following: SimonN/LixD#121
Note: I don't know whether the same should or can be done for the D v1 version with Thread.thread_attach/detach so I didn't touch it.
From the documentation on
thread_attachThis
:thread_detachThis
has a similar note about callingrt_moduleTlsDtor
afterthread_detachThis
.This prevents bugs like the following: SimonN/LixD#121
Note: I don't know whether the same should or can be done for the D v1 version with
Thread.thread_attach/detach
so I didn't touch it.