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 git-svn-id: svn://10.0.0.236/trunk@111126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c6b3b7cb73
commit
5c3a0a59b9
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user