summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2004-10-21 03:42:24 +0000
committerdavidxu <davidxu@FreeBSD.org>2004-10-21 03:42:24 +0000
commit261287ba18aa351ec16912a2773fd2869ee5a58f (patch)
tree34a74eccc142f9ab28d8649df1962be57dad1faf /lib
parent38cc47efeac74681bd2df1cbe61fcba824f57ea6 (diff)
downloadFreeBSD-src-261287ba18aa351ec16912a2773fd2869ee5a58f.zip
FreeBSD-src-261287ba18aa351ec16912a2773fd2869ee5a58f.tar.gz
Decrease reference count if we won't use the thread, this avoids memory
leak under some cases.
Diffstat (limited to 'lib')
-rw-r--r--lib/libkse/thread/thr_sig.c4
-rw-r--r--lib/libpthread/thread/thr_sig.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c
index 0f84db8..81982d7 100644
--- a/lib/libkse/thread/thr_sig.c
+++ b/lib/libkse/thread/thr_sig.c
@@ -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)) {
/*
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index 0f84db8..81982d7 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -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)) {
/*
OpenPOWER on IntegriCloud