summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_kill.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-13 07:03:01 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-13 07:03:01 +0000
commite87e922f3125332f002638f5f231acc7544b7ebf (patch)
tree82f35174d92e7167b6c95a574f45720b60ded582 /lib/libthr/thread/thr_kill.c
parent8ff2afea3997418eb503ad0843ed126e994fe54b (diff)
downloadFreeBSD-src-e87e922f3125332f002638f5f231acc7544b7ebf.zip
FreeBSD-src-e87e922f3125332f002638f5f231acc7544b7ebf.tar.gz
Convert thread list lock from mutex to rwlock.
Diffstat (limited to 'lib/libthr/thread/thr_kill.c')
-rw-r--r--lib/libthr/thread/thr_kill.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_kill.c b/lib/libthr/thread/thr_kill.c
index 97d4fe6..b54458c58 100644
--- a/lib/libthr/thread/thr_kill.c
+++ b/lib/libthr/thread/thr_kill.c
@@ -54,11 +54,15 @@ _pthread_kill(pthread_t pthread, int sig)
* signal is valid (signal 0 specifies error checking only) and
* not being ignored:
*/
- else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0))
+ else if (curthread == pthread) {
+ if (sig > 0)
+ _thr_send_sig(pthread, sig);
+ ret = 0;
+ } if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))
== 0) {
if (sig > 0)
_thr_send_sig(pthread, sig);
- _thr_ref_delete(curthread, pthread);
+ THR_THREAD_UNLOCK(curthread, pthread);
}
/* Return the completion status: */
OpenPOWER on IntegriCloud