summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2012-07-20 01:56:14 +0000
committerdavidxu <davidxu@FreeBSD.org>2012-07-20 01:56:14 +0000
commitb941de51c7f790e80d83a683e6874e2a56590e3d (patch)
tree71afb200dab94dfbb745da7805cc6c9db8c198ab /lib
parent4939a38c3ff2514dd05b548d9140115b908b26ea (diff)
downloadFreeBSD-src-b941de51c7f790e80d83a683e6874e2a56590e3d.zip
FreeBSD-src-b941de51c7f790e80d83a683e6874e2a56590e3d.tar.gz
Don't forget to release a thread reference count,
replace _thr_ref_add() with _thr_find_thread(), so reference count is no longer needed. MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_setschedparam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_setschedparam.c b/lib/libthr/thread/thr_setschedparam.c
index 59d62dc..a8a15d1 100644
--- a/lib/libthr/thread/thr_setschedparam.c
+++ b/lib/libthr/thread/thr_setschedparam.c
@@ -70,9 +70,8 @@ _pthread_setschedparam(pthread_t pthread, int policy,
curthread->attr.prio = param->sched_priority;
}
THR_UNLOCK(curthread);
- } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0))
- == 0) {
- THR_THREAD_LOCK(curthread, pthread);
+ } else if ((ret = _thr_find_thread(curthread, pthread,
+ /*include dead*/0)) == 0) {
if (pthread->attr.sched_policy == policy &&
(policy == SCHED_OTHER ||
pthread->attr.prio == param->sched_priority)) {
@@ -88,7 +87,6 @@ _pthread_setschedparam(pthread_t pthread, int policy,
pthread->attr.prio = param->sched_priority;
}
THR_THREAD_UNLOCK(curthread, pthread);
- _thr_ref_delete(curthread, pthread);
}
return (ret);
}
OpenPOWER on IntegriCloud