Decrease reference count if we won't use the thread, this avoids memory

leak under some cases.
This commit is contained in:
David Xu 2004-10-21 03:42:24 +00:00
parent f742a1edcd
commit 39454d368f
2 changed files with 8 additions and 0 deletions

View File

@ -705,6 +705,10 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
if (kmbx != NULL)
kse_wakeup(kmbx);
if (suspended_thread != NULL)
_thr_ref_delete(NULL, suspended_thread);
if (signaled_thread != NULL)
_thr_ref_delete(NULL, signaled_thread);
return (NULL);
} else if (!SIGISMEMBER(pthread->sigmask, sig)) {
/*

View File

@ -705,6 +705,10 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
if (kmbx != NULL)
kse_wakeup(kmbx);
if (suspended_thread != NULL)
_thr_ref_delete(NULL, suspended_thread);
if (signaled_thread != NULL)
_thr_ref_delete(NULL, signaled_thread);
return (NULL);
} else if (!SIGISMEMBER(pthread->sigmask, sig)) {
/*