diff options
author | davidxu <davidxu@FreeBSD.org> | 2012-07-20 03:22:17 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2012-07-20 03:22:17 +0000 |
commit | 4583d3fdda444b54d1b6c10aead93bd7a73c8b7b (patch) | |
tree | 97e62716e3689f1a135a3357841a0991226563cb /lib/libthr/thread/thr_setprio.c | |
parent | 8673cbd4778dbd00c4a37ca2bd00b67ae369311f (diff) | |
download | FreeBSD-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.c | 5 |
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) { |