prevent multiple calls to rt_term

Ellery Newcomer ellery-newcomer at utulsa.edu
Mon Aug 13 13:14:53 PDT 2012


Hello.

In Pyd, I am trying to get python extension libraries working, but this 
requires building shared libraries with D. LDC works adequately for 
this, if you don't mind not having module constructors or unittests; 
however, in the presence of multiple shared libraries coordinating 
rt_init and rt_term seems to be an issue.

Currently, I have each shared lib calling rt_init in _init and rt_term 
in _fini. I would like to know if druntime supports a way to detect if 
it is running.

For rt_term, I have been using rt.dmain2.isHalting, but that seems to 
have gone away in more recent druntime, and anyways doesn't seem to be 
working for me.

I wonder if it would make more sense to call rt_init and rt_term in the 
druntime shared lib's _init and _fini?


More information about the Digitalmars-d-learn mailing list