rt_init, rt_term and _initCount

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 21 16:21:48 PDT 2016


On Friday, 21 October 2016 at 19:40:52 UTC, Rainer Schuetze wrote:
>
> The wrapper around main in the executable should work just as 
> any DLLs' DllMain, i.e. it should register/unregister its own 
> data segments with the GC and run its shared and TLS module 
> constructors/decoontructors. Everything else should be handled 
> by the druntime DLL.

Yes, I also considered that option. The problem with that is, 
that druntime deinit joins alls threads before running the shared 
module dtors. If the main executable behaves exactly like the 
dlls do this joining of threads would be lost and different from 
the behavior of a fully statical linked executable.


More information about the Digitalmars-d mailing list