зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 96199: added _PR_CleanupMW() to clean up the static data
created by prmwait.c. The patch is contributed by Jeff Hostetler <jeff@NerdOne.com>. Modified files: primpl.h prmwait.c prinit.c ptthread.c
This commit is contained in:
Родитель
875212386d
Коммит
0541c0a0af
|
@ -1742,6 +1742,7 @@ extern void _PR_InitRWLocks(void);
|
|||
extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
|
||||
extern void _PR_CleanupThread(PRThread *thread);
|
||||
extern void _PR_CleanupCallOnce(void);
|
||||
extern void _PR_CleanupMW(void);
|
||||
extern void _PR_CleanupDtoa(void);
|
||||
extern void _PR_ShutdownLinker(void);
|
||||
extern void _PR_CleanupEnv(void);
|
||||
|
|
|
@ -269,6 +269,17 @@ void _PR_InitMW(void)
|
|||
max_polling_interval = PR_MillisecondsToInterval(MAX_POLLING_INTERVAL);
|
||||
} /* _PR_InitMW */
|
||||
|
||||
void _PR_CleanupMW(void)
|
||||
{
|
||||
PR_DestroyLock(mw_lock);
|
||||
mw_lock = NULL;
|
||||
if (mw_state->group) {
|
||||
PR_DestroyWaitGroup(mw_state->group);
|
||||
/* mw_state->group is set to NULL as a side effect. */
|
||||
}
|
||||
PR_DELETE(mw_state);
|
||||
} /* _PR_CleanupMW */
|
||||
|
||||
static PRWaitGroup *MW_Init2(void)
|
||||
{
|
||||
PRWaitGroup *group = mw_state->group; /* it's the null group */
|
||||
|
|
|
@ -417,6 +417,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
|
|||
PR_ASSERT((_PR_IS_NATIVE_THREAD(me)) || (me->cpu->id == 0));
|
||||
#endif
|
||||
|
||||
_PR_CleanupMW();
|
||||
_PR_CleanupDtoa();
|
||||
_PR_CleanupCallOnce();
|
||||
_PR_ShutdownLinker();
|
||||
|
|
|
@ -920,6 +920,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
|
|||
PR_WaitCondVar(pt_book.cv, PR_INTERVAL_NO_TIMEOUT);
|
||||
PR_Unlock(pt_book.ml);
|
||||
|
||||
_PR_CleanupMW();
|
||||
_PR_CleanupDtoa();
|
||||
_PR_CleanupCallOnce();
|
||||
_PR_ShutdownLinker();
|
||||
|
|
Загрузка…
Ссылка в новой задаче