* dcrt0.cc (atexit_lock): Delete.
(cygwin_exit): Remove atexit lock. (cygwin_atexit): Ditto. Rename parameter to match newlib. Call __cxa_atexit when invoked by a registered DLL. * dll_init.cc (remove_dll_atexit): Delete. (dll_list::find): New function. (dll_list::detach): Use dll_list::find to find dll associated with return address. Use __cxa_finalize to run atexit functions associated with the dll. (cygwin_detach_dll): Don't assume that HANDLE == void *. * dll_init.h (dll_list::find): Declare. (__cxa_atexit): Ditto. (__cxa_finalize): Ditto. * init.cc (dll_entry): Clarify comment.
This commit is contained in:
@ -79,6 +79,7 @@ public:
|
||||
int reload_on_fork;
|
||||
dll *operator [] (const PWCHAR name);
|
||||
dll *alloc (HINSTANCE, per_process *, dll_type);
|
||||
dll *find (void *);
|
||||
void detach (void *);
|
||||
void init ();
|
||||
void load_after_fork (HANDLE);
|
||||
@ -100,3 +101,8 @@ public:
|
||||
|
||||
extern dll_list dlls;
|
||||
void dll_global_dtors ();
|
||||
|
||||
/* These probably belong in a newlib header but we can keep them here
|
||||
for now. */
|
||||
extern "C" int __cxa_atexit(void (*)(void*), void*, void*);
|
||||
extern "C" int __cxa_finalize(void*);
|
||||
|
Reference in New Issue
Block a user