diff options
author | davidxu <davidxu@FreeBSD.org> | 2007-04-05 07:20:31 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2007-04-05 07:20:31 +0000 |
commit | 2dd85eafce09300420147a7970e0090a10180715 (patch) | |
tree | 2fd30c56c01515e20f11a95736430d23b0aa0b2d /lib/libthr | |
parent | f267b347f9e50af1a2cd970d17b45cffb7749d7a (diff) | |
download | FreeBSD-src-2dd85eafce09300420147a7970e0090a10180715.zip FreeBSD-src-2dd85eafce09300420147a7970e0090a10180715.tar.gz |
If a thread who's name is being set is not the current thread, use macros
THR_THREAD_LOCK and THR_THREAD_UNLOCK instead, this should fix wrong
lock level problem.
Bug reported by: ed dot maste at gmail dot com
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_info.c b/lib/libthr/thread/thr_info.c index c16f34a..2da6da2 100644 --- a/lib/libthr/thread/thr_info.c +++ b/lib/libthr/thread/thr_info.c @@ -52,12 +52,12 @@ _pthread_set_name_np(pthread_t thread, const char *name) ret = errno; } else { if (_thr_ref_add(curthread, thread, 0) == 0) { - THR_LOCK(thread); + THR_THREAD_LOCK(curthread, thread); if (thread->state != PS_DEAD) { if (thr_set_name(thread->tid, name)) ret = errno; } - THR_UNLOCK(thread); + THR_THREAD_UNLOCK(curthread, thread); _thr_ref_delete(curthread, thread); } else { ret = ESRCH; |