mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bugzilla bug 214411: fixed a bug introduced in the previous checkin.
threadid_key_destructor may get called on the primordial thread if the app doesn't call PR_Cleanup and the assertion would fail. Thanks to Gerard Roos <gerard.roos@adnovum.ch> for contributing the patch.
This commit is contained in:
parent
039566e00c
commit
3d84d300c8
@ -187,16 +187,19 @@ static void
|
||||
threadid_key_destructor(void *value)
|
||||
{
|
||||
PRThread *me = (PRThread *)value;
|
||||
PR_ASSERT((me != NULL) && (me->flags & _PR_ATTACHED));
|
||||
/*
|
||||
* The Solaris thread library sets the thread specific
|
||||
* data (the current thread) to NULL before invoking
|
||||
* the destructor. We need to restore it to prevent the
|
||||
* _PR_MD_CURRENT_THREAD() call in _PRI_DetachThread()
|
||||
* from attaching the thread again.
|
||||
*/
|
||||
_PR_MD_SET_CURRENT_THREAD(me);
|
||||
_PRI_DetachThread();
|
||||
PR_ASSERT(me != NULL);
|
||||
/* the thread could be PRIMORDIAL (thus not ATTACHED) */
|
||||
if (me->flags & _PR_ATTACHED) {
|
||||
/*
|
||||
* The Solaris thread library sets the thread specific
|
||||
* data (the current thread) to NULL before invoking
|
||||
* the destructor. We need to restore it to prevent the
|
||||
* _PR_MD_CURRENT_THREAD() call in _PRI_DetachThread()
|
||||
* from attaching the thread again.
|
||||
*/
|
||||
_PR_MD_SET_CURRENT_THREAD(me);
|
||||
_PRI_DetachThread();
|
||||
}
|
||||
}
|
||||
|
||||
void _MD_EarlyInit(void)
|
||||
|
Loading…
Reference in New Issue
Block a user