LDC_global_crt_ctor for threads
Calvin P
changlon at gmail.com
Thu Apr 2 17:07:58 UTC 2020
On Thursday, 2 April 2020 at 15:28:43 UTC, Marcel wrote:
> Hello!
> Is there a way to call a cleanup function when a thread
> terminates, like with LDC_global_crt_ctor? I can't use module
> ctor/dtors since I'm using BetterC.
a simple scope(exit) do_clear(); in the thread entry function
will do the work.
if you need put them in multi files, you need constructor a
global list or array, init from LDC_global_crt_ctor. then call
from thread entry function.
More information about the digitalmars-d-ldc
mailing list