Backing out bug 749849 patch v6 as an attempt to fix the recently introduced intermittent crashes.
git-svn-id: svn://10.0.0.236/trunk@264368 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -130,6 +130,8 @@
|
||||
#define _PT_PTHREAD_ATTR_DESTROY pthread_attr_delete
|
||||
#define _PT_PTHREAD_CREATE(t, a, f, r) pthread_create(t, a, f, r)
|
||||
#define _PT_PTHREAD_KEY_CREATE pthread_keycreate
|
||||
#define _PT_PTHREAD_KEY_DELETE pthread_keydelete
|
||||
/* Set _PT_PTHREAD_KEY_DELETE to empty if pthread_keydelete isn't available */
|
||||
#define _PT_PTHREAD_ATTR_SETSCHEDPOLICY pthread_attr_setsched
|
||||
#define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) \
|
||||
(*(s) = pthread_attr_getstacksize(*(a)), 0)
|
||||
@@ -140,6 +142,7 @@
|
||||
#define _PT_PTHREAD_ATTR_DESTROY pthread_attr_destroy
|
||||
#define _PT_PTHREAD_CREATE(t, a, f, r) pthread_create(t, &a, f, r)
|
||||
#define _PT_PTHREAD_KEY_CREATE pthread_key_create
|
||||
#define _PT_PTHREAD_KEY_DELETE pthread_key_delete
|
||||
#define _PT_PTHREAD_ATTR_SETSCHEDPOLICY pthread_attr_setschedpolicy
|
||||
#define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) pthread_attr_getstacksize(a, s)
|
||||
#define _PT_PTHREAD_GETSPECIFIC(k, r) (r) = pthread_getspecific(k)
|
||||
|
||||
@@ -43,7 +43,7 @@ static struct _PT_Bookeeping
|
||||
PRCondVar *cv; /* used to signal global things */
|
||||
PRInt32 system, user; /* a count of the two different types */
|
||||
PRUintn this_many; /* number of threads allowed for exit */
|
||||
pthread_key_t key; /* thread private data key */
|
||||
pthread_key_t key; /* private private data key */
|
||||
PRThread *first, *last; /* list of threads we know about */
|
||||
#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
|
||||
PRInt32 minPrio, maxPrio; /* range of scheduling priorities */
|
||||
@@ -975,8 +975,7 @@ 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_PTHREAD_KEY_DELETE(pt_book.key);
|
||||
/* TODO: free other resources used by NSPR */
|
||||
/* _pr_initialized = PR_FALSE; */
|
||||
} /* _PR_Fini */
|
||||
@@ -1016,16 +1015,14 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
|
||||
PR_ASSERT(0 == rv);
|
||||
/*
|
||||
* I am not sure if it's safe to delete the cv and lock here,
|
||||
* since there may still be "system" or "foreign" threads
|
||||
* around. If this call isn't immediately prior to exiting,
|
||||
* then there's a problem.
|
||||
* since there may still be "system" threads around. If this
|
||||
* call isn't immediately prior to exiting, then there's a
|
||||
* problem.
|
||||
*/
|
||||
if (0 == pt_book.system && NULL == pt_book.first)
|
||||
if (0 == pt_book.system)
|
||||
{
|
||||
PR_DestroyCondVar(pt_book.cv); pt_book.cv = NULL;
|
||||
PR_DestroyLock(pt_book.ml); pt_book.ml = NULL;
|
||||
rv = pthread_key_delete(pt_book.key);
|
||||
PR_ASSERT(0 == rv);
|
||||
}
|
||||
PR_DestroyLock(_pr_sleeplock);
|
||||
_pr_sleeplock = NULL;
|
||||
|
||||
Reference in New Issue
Block a user