Another thing you should keep in mind is that thread_attachThis() does not invoke any module TLS constructors, so you should also call rt_moduleTlsCtor() unless you are absolutely sure none of the modules you use have one. Call rt_moduleTlsCtor() before you detach the thread. Those functions are not part of the official API, so you might have to declare them with

extern(C)
{
    void rt_moduleTlsCtor();
    void rt_moduleTlsDtor();
}

Reply via email to