summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-17 22:28:58 +0000
committerjhb <jhb@FreeBSD.org>2003-04-17 22:28:58 +0000
commit2cdea9a30c27c6defb0ba1499ce06ef78eceade1 (patch)
tree7f05b753c33a0474e1f033cc1c76a2c2688706de /sys/kern/kern_mutex.c
parentc94962975bf64ebaaf76de7d9de1dba25825bc1d (diff)
downloadFreeBSD-src-2cdea9a30c27c6defb0ba1499ce06ef78eceade1.zip
FreeBSD-src-2cdea9a30c27c6defb0ba1499ce06ef78eceade1.tar.gz
Use TD_IS_RUNNING() instead of thread_running() in the adaptive mutex
code.
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 0722931..a2617f9 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -70,11 +70,6 @@
#define mtx_owner(m) (mtx_unowned((m)) ? NULL \
: (struct thread *)((m)->mtx_lock & MTX_FLAGMASK))
-/* XXXKSE This test will change. */
-#define thread_running(td) \
- (td->td_state == TDS_RUNNING)
- /* ((td)->td_oncpu != NOCPU) */
-
/*
* Lock classes for sleep and spin mutexes.
*/
@@ -561,9 +556,9 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line)
* CPU, spin instead of blocking.
*/
owner = (struct thread *)(v & MTX_FLAGMASK);
- if (m != &Giant && thread_running(owner)) {
+ if (m != &Giant && TD_IS_RUNNING(owner)) {
mtx_unlock_spin(&sched_lock);
- while (mtx_owner(m) == owner && thread_running(owner)) {
+ while (mtx_owner(m) == owner && TD_IS_RUNNING(owner)) {
#ifdef __i386__
ia32_pause();
#endif
OpenPOWER on IntegriCloud