diff options
author | JustOff <Off.Just.Off@gmail.com> | 2018-06-09 15:09:22 +0300 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2018-06-11 16:42:09 +0300 |
commit | 75323087aea91719bbb4f766bc6298d0618f0163 (patch) | |
tree | 3f72a9a552289f158def1a871c19d40ce2bf4d31 /nsprpub/pr/src/pthreads | |
parent | b1d82a62259c6888ea6f3f71f3e0973ea4b4e85e (diff) | |
download | UXP-75323087aea91719bbb4f766bc6298d0618f0163.tar UXP-75323087aea91719bbb4f766bc6298d0618f0163.tar.gz UXP-75323087aea91719bbb4f766bc6298d0618f0163.tar.lz UXP-75323087aea91719bbb4f766bc6298d0618f0163.tar.xz UXP-75323087aea91719bbb4f766bc6298d0618f0163.zip |
Update NSPR to 4.19
Diffstat (limited to 'nsprpub/pr/src/pthreads')
-rw-r--r-- | nsprpub/pr/src/pthreads/.cvsignore | 1 | ||||
-rw-r--r-- | nsprpub/pr/src/pthreads/ptthread.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/nsprpub/pr/src/pthreads/.cvsignore b/nsprpub/pr/src/pthreads/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/nsprpub/pr/src/pthreads/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c index 6046d5d8d..e61a4cbde 100644 --- a/nsprpub/pr/src/pthreads/ptthread.c +++ b/nsprpub/pr/src/pthreads/ptthread.c @@ -978,7 +978,23 @@ void _PR_InitThreads( * GCC supports the constructor and destructor attributes as of * version 2.5. */ +#if defined(DARWIN) +/* + * The dynamic linker on OSX doesn't execute __attribute__((destructor)) + * destructors in the right order wrt non-__attribute((destructor)) destructors + * in other libraries. So use atexit() instead, which does. + * See https://bugzilla.mozilla.org/show_bug.cgi?id=1399746#c99 + */ +static void _PR_Fini(void); + +__attribute__ ((constructor)) +static void _register_PR_Fini() { + atexit(_PR_Fini); +} +#else static void _PR_Fini(void) __attribute__ ((destructor)); +#endif + #elif defined(__SUNPRO_C) /* * Sun Studio compiler |