Bug 1399746, backout patch that was landed accidentally, r=glandium for backout NSPR_4_18_BETA3
authorKai Engert <kaie@kuix.de>
Thu, 07 Dec 2017 12:18:09 +0100
changeset 4768 8d2ea9b5cc6dce3df90f11dd304eb149a036569c
parent 4767 ca654cbefd8cf0d317e824ec11eb7891605b2109
child 4769 9061ac5e94d4a9edac999a8b961098931ed982ed
push id281
push userkaie@kuix.de
push dateThu, 07 Dec 2017 11:18:02 +0000
reviewersglandium
bugs1399746
Bug 1399746, backout patch that was landed accidentally, r=glandium for backout
pr/src/pthreads/ptthread.c
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -1059,21 +1059,16 @@ void PR_HPUX10xInit(shl_t handle, int lo
 }
 #endif
 #elif defined(AIX)
 /* Need to use the -binitfini::_PR_Fini linker option. */
 #endif
 
 void _PR_Fini(void)
 {
-    /* We disable the cleanup code on Mac OSX, see bug 1399746.
-     * The .dylib containing NSPR can get unloaded, and _PR_Fini called,
-     * and other code calling NSPR functions can get executed afterwards.
-    */
-#ifndef DARWIN
     void *thred;
     int rv;
 
     if (!_pr_initialized) {
         /* Either NSPR was never successfully initialized or 
          * PR_Cleanup has been called already. */
         if (pt_book.keyCreated)
         {
@@ -1095,17 +1090,16 @@ void _PR_Fini(void)
         rv = pthread_setspecific(pt_book.key, NULL);
         PR_ASSERT(0 == rv);
     }
     rv = pthread_key_delete(pt_book.key);
     PR_ASSERT(0 == rv);
     pt_book.keyCreated = PR_FALSE;
     /* TODO: free other resources used by NSPR */
     /* _pr_initialized = PR_FALSE; */
-#endif
 }  /* _PR_Fini */
 
 PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
 {
     PRThread *me = PR_GetCurrentThread();
     int rv;
     PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("PR_Cleanup: shutting down NSPR"));
     PR_ASSERT(me->state & PT_THREAD_PRIMORD);