summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_setschedparam.c
diff options
context:
space:
mode:
authorMike Makonnen <mtm@FreeBSD.org>2004-05-20 12:06:16 +0000
committerMike Makonnen <mtm@FreeBSD.org>2004-05-20 12:06:16 +0000
commit4cd18a22d554e7205ddf0408badbda02411ed51e (patch)
tree191973c93de49160bb4144ea98ee350f5906d883 /lib/libthr/thread/thr_setschedparam.c
parent3ef392f38b3dfe29567e295d07ec36e8d34056a8 (diff)
Notes
Diffstat (limited to 'lib/libthr/thread/thr_setschedparam.c')
-rw-r--r--lib/libthr/thread/thr_setschedparam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_setschedparam.c b/lib/libthr/thread/thr_setschedparam.c
index e90def4f67fa..de4eeea43d80 100644
--- a/lib/libthr/thread/thr_setschedparam.c
+++ b/lib/libthr/thread/thr_setschedparam.c
@@ -76,11 +76,11 @@ _pthread_setschedparam(pthread_t pthread, int policy,
* LOR avoidance code.
*/
do {
- _thread_critical_enter(pthread);
- if (pthread->state == PS_MUTEX_WAIT) {
+ PTHREAD_LOCK(pthread);
+ if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0) {
mtx = pthread->data.mutex;
if (_spintrylock(&mtx->lock) == EBUSY)
- _thread_critical_exit(pthread);
+ PTHREAD_UNLOCK(pthread);
else
break;
} else {
@@ -115,7 +115,7 @@ _pthread_setschedparam(pthread_t pthread, int policy,
}
pthread->attr.sched_policy = policy;
- _thread_critical_exit(pthread);
+ PTHREAD_UNLOCK(pthread);
if (mtx != NULL)
_SPINUNLOCK(&mtx->lock);
return(0);