зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
738e508fc2
Коммит
ee87ba706d
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче