LDC_global_crt_ctor for threads

Marcel marcelpi97 at gmail.com
Fri Apr 3 19:16:04 UTC 2020


On Friday, 3 April 2020 at 00:37:39 UTC, kinke wrote:
> On Thursday, 2 April 2020 at 22:16:45 UTC, Marcel wrote:
>> Oh, I didn't explain my situation properly: I'm writing a 
>> memory allocation library and there's some thread local state 
>> that I must take care of when the thread exits. Now, I can 
>> always do as you said and ask the user to place calls to 
>> certain functions at thread main, but I'd really prefer if 
>> that was done automatically.
>
> You'll need some sort of runtime support for automation, so if 
> you don't use druntime because of -betterC, you'll need to look 
> (and ask) elsewhere. C doesn't have such a thing AFAIK; the C++ 
> runtime may have something like __cxa_thread_atexit (e.g., used 
> by clang for a thread_local global with dtor when targeting 
> glibc).

I see... A shame but it's understandable.
Thank you anyway :)


More information about the digitalmars-d-ldc mailing list