Use TD_IS_RUNNING() instead of thread_running() in the adaptive mutex

code.
This commit is contained in:
John Baldwin 2003-04-17 22:28:58 +00:00
parent 0bfc4d1445
commit 27dad03c97
2 changed files with 4 additions and 14 deletions

View File

@ -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

View File

@ -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