diff options
author | 2002-11-04 21:28:49 +0000 | |
---|---|---|
committer | 2002-11-04 21:28:49 +0000 | |
commit | dd5ec75ee25657d249f7478f1116640a7f1aa582 (patch) | |
tree | 3373ad5e07838b8b869c01b71be36f9cc94cd52a /lib/libpthread/uthread | |
parent | sync uucp/uucp owner/group with that validated in special. (diff) | |
download | wireguard-openbsd-dd5ec75ee25657d249f7478f1116640a7f1aa582.tar.xz wireguard-openbsd-dd5ec75ee25657d249f7478f1116640a7f1aa582.zip |
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.c | 11 |
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); |