summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r--lib/libthr/thread/thr_setprio.c5
-rw-r--r--lib/libthr/thread/thr_setschedparam.c5
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 &&
OpenPOWER on IntegriCloud