summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_setprio.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2012-07-20 03:22:17 +0000
committerdavidxu <davidxu@FreeBSD.org>2012-07-20 03:22:17 +0000
commit4583d3fdda444b54d1b6c10aead93bd7a73c8b7b (patch)
tree97e62716e3689f1a135a3357841a0991226563cb /lib/libthr/thread/thr_setprio.c
parent8673cbd4778dbd00c4a37ca2bd00b67ae369311f (diff)
downloadFreeBSD-src-4583d3fdda444b54d1b6c10aead93bd7a73c8b7b.zip
FreeBSD-src-4583d3fdda444b54d1b6c10aead93bd7a73c8b7b.tar.gz
Don't assign same value.
Diffstat (limited to 'lib/libthr/thread/thr_setprio.c')
-rw-r--r--lib/libthr/thread/thr_setprio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_setprio.c b/lib/libthr/thread/thr_setprio.c
index b87d536..4b7d2c0 100644
--- a/lib/libthr/thread/thr_setprio.c
+++ b/lib/libthr/thread/thr_setprio.c
@@ -45,10 +45,9 @@ _pthread_setprio(pthread_t pthread, int prio)
int ret;
param.sched_priority = prio;
- if (pthread == curthread) {
- pthread = curthread;
+ if (pthread == curthread)
THR_LOCK(curthread);
- } else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)))
+ else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)))
return (ret);
if (pthread->attr.sched_policy == SCHED_OTHER ||
pthread->attr.prio == prio) {
OpenPOWER on IntegriCloud