From 4583d3fdda444b54d1b6c10aead93bd7a73c8b7b Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 20 Jul 2012 03:22:17 +0000 Subject: Don't assign same value. --- lib/libthr/thread/thr_setschedparam.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libthr/thread/thr_setschedparam.c') 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 && -- cgit v1.1