summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2002-11-04 21:28:50 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2002-11-04 21:28:50 +0000
commit5ea4f1e0e49682bfd8dde21d76785297fe9650e5 (patch)
tree929cd41a663b5c756d9ed2d441b375f501dd3363 /lib/libpthread/uthread
parent0abb0ece6647661bf7734e5e779297b00330f2ea (diff)
test locks against _SPINLOCK_UNLOCKED, not 0. _SPINLOCK_UNLOCKED is
not zero on all arches
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r--lib/libpthread/uthread/uthread_kern.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libpthread/uthread/uthread_kern.c b/lib/libpthread/uthread/uthread_kern.c
index f7db1f0871b..cf1a6dcf6ac 100644
--- a/lib/libpthread/uthread/uthread_kern.c
+++ b/lib/libpthread/uthread/uthread_kern.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_kern.c,v 1.22 2002/10/30 19:11:56 marc Exp $ */
+/* $OpenBSD: uthread_kern.c,v 1.23 2002/11/04 21:28:49 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -729,7 +729,8 @@ _thread_kern_poll(int wait_reqd)
/*
* If the lock is available, let the thread run.
*/
- if (pthread->data.spinlock->access_lock == 0) {
+ if (pthread->data.spinlock->access_lock ==
+ _SPINLOCK_UNLOCKED) {
PTHREAD_WAITQ_CLEARACTIVE();
PTHREAD_WORKQ_REMOVE(pthread);
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
@@ -840,7 +841,8 @@ _thread_kern_poll(int wait_reqd)
/*
* If the lock is available, let the thread run.
*/
- if (pthread->data.spinlock->access_lock == 0) {
+ if (pthread->data.spinlock->access_lock ==
+ _SPINLOCK_UNLOCKED) {
PTHREAD_WAITQ_CLEARACTIVE();
PTHREAD_WORKQ_REMOVE(pthread);
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
@@ -928,7 +930,8 @@ _thread_kern_poll(int wait_reqd)
/*
* If the lock is available, let the thread run.
*/
- if (pthread->data.spinlock->access_lock == 0) {
+ if (pthread->data.spinlock->access_lock ==
+ _SPINLOCK_UNLOCKED) {
PTHREAD_WAITQ_CLEARACTIVE();
PTHREAD_WORKQ_REMOVE(pthread);
PTHREAD_NEW_STATE(pthread,PS_RUNNING);