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 | |
parent | 8673cbd4778dbd00c4a37ca2bd00b67ae369311f (diff) | |
download | FreeBSD-src-4583d3fdda444b54d1b6c10aead93bd7a73c8b7b.zip FreeBSD-src-4583d3fdda444b54d1b6c10aead93bd7a73c8b7b.tar.gz |
Don't assign same value.
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_setprio.c | 5 | ||||
-rw-r--r-- | lib/libthr/thread/thr_setschedparam.c | 5 |
2 files changed, 4 insertions, 6 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) { diff --git a/lib/libthr/thread/thr_setschedparam.c b/lib/libthr/thread/thr_setschedparam.c index 343e49c..6e98fb4 100644 --- a/lib/libthr/thread/thr_setschedparam.c +++ b/lib/libthr/thread/thr_setschedparam.c @@ -53,10 +53,9 @@ _pthread_setschedparam(pthread_t pthread, int policy, struct pthread *curthread = _get_curthread(); int ret; - if (pthread == curthread) { - pthread = curthread; + if (pthread == curthread) THR_LOCK(curthread); - } else if ((ret = _thr_find_thread(curthread, pthread, + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) != 0) return (ret); if (pthread->attr.sched_policy == policy && |