diff options
author | wtc%netscape.com <devnull@localhost> | 2001-08-29 23:13:41 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-08-29 23:13:41 +0000 |
commit | 359d447f593c8513443c8007e9026bbfc9b9589f (patch) | |
tree | 0565d700e19cc77bcc989d980b54f13b463146b9 /pr | |
parent | 578dd54ac2734f6e4990658cd4ef8d273c10c764 (diff) | |
download | nspr-hg-359d447f593c8513443c8007e9026bbfc9b9589f.tar.gz |
Bugzilla bug 95659: added _PR_CleanupStacks(), which is called from
PR_Cleanup(). The patch is contributed by jeff@NerdOne.com.
Modified files: primpl.h, prinit.c, prustack.c
Diffstat (limited to 'pr')
-rw-r--r-- | pr/include/private/primpl.h | 1 | ||||
-rw-r--r-- | pr/src/misc/prinit.c | 1 | ||||
-rw-r--r-- | pr/src/threads/combined/prustack.c | 8 |
3 files changed, 10 insertions, 0 deletions
diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index eb1dd716..328d0f1f 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -1735,6 +1735,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_CleanupStacks(void); extern void _PR_CleanupTPD(void); extern void _PR_Cleanup(void); extern void _PR_LogCleanup(void); diff --git a/pr/src/misc/prinit.c b/pr/src/misc/prinit.c index 46cd57df..78c4dff3 100644 --- a/pr/src/misc/prinit.c +++ b/pr/src/misc/prinit.c @@ -446,6 +446,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() * Ideally, for each _PR_InitXXX(), there should be a corresponding * _PR_XXXCleanup() that we can call here. */ + _PR_CleanupStacks(); _PR_CleanupBeforeExit(); _pr_initialized = PR_FALSE; return PR_SUCCESS; diff --git a/pr/src/threads/combined/prustack.c b/pr/src/threads/combined/prustack.c index aa7d2bfa..3f12c568 100644 --- a/pr/src/threads/combined/prustack.c +++ b/pr/src/threads/combined/prustack.c @@ -58,6 +58,14 @@ void _PR_InitStacks(void) _pr_stackLock = PR_NewLock(); } +void _PR_CleanupStacks(void) +{ + if (_pr_stackLock) { + PR_DestroyLock(_pr_stackLock); + _pr_stackLock = NULL; + } +} + /* ** Allocate a stack for a thread. */ |