Bugzilla bug 96197: added _PR_CleanupCallOnce() to destroy the lock and

condition variable used to implement PR_CallOnce.  This patch is
contributed by Jeff Hostetler <jeff@NerdOne.com>.
Modified files: primpl.h prinit.c ptthread.c
This commit is contained in:
wtc%netscape.com 2001-12-28 03:24:02 +00:00
parent 0fcc6e185d
commit 2be0d601ec
3 changed files with 10 additions and 0 deletions

View File

@ -1741,6 +1741,7 @@ extern void _PR_InitMW(void);
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_ShutdownLinker(void);
extern void _PR_CleanupEnv(void);
extern void _PR_CleanupIO(void);

View File

@ -417,6 +417,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
PR_ASSERT((_PR_IS_NATIVE_THREAD(me)) || (me->cpu->id == 0));
#endif
_PR_CleanupCallOnce();
_PR_ShutdownLinker();
/* Release the primordial thread's private data, etc. */
_PR_CleanupThread(me);
@ -782,6 +783,13 @@ static void _PR_InitCallOnce() {
PR_ASSERT(NULL != mod_init.cv);
}
void _PR_CleanupCallOnce()
{
PR_DestroyLock(mod_init.ml);
mod_init.ml = NULL;
PR_DestroyCondVar(mod_init.cv);
mod_init.cv = NULL;
}
PR_IMPLEMENT(PRStatus) PR_CallOnce(
PRCallOnceType *once,

View File

@ -920,6 +920,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
PR_WaitCondVar(pt_book.cv, PR_INTERVAL_NO_TIMEOUT);
PR_Unlock(pt_book.ml);
_PR_CleanupCallOnce();
_PR_ShutdownLinker();
_PR_LogCleanup();
_PR_CleanupNet();