From 0e54ddadd98718e51a0a5c34e83c6bdd55195282 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 21 May 2002 21:27:05 +0000 Subject: [PATCH] Fix an old cut 'n' paste bug inherited from BSD/OS: don't increment 'i' twice once we are in the long wait stage of spinning on a spin mutex. --- sys/kern/kern_mutex.c | 2 +- sys/kern/subr_turnstile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 2430804084df..153b5058e301 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -621,7 +621,7 @@ _mtx_lock_spin(struct mtx *m, int opts, const char *file, int line) while (m->mtx_lock != MTX_UNOWNED) { if (i++ < 10000000) continue; - if (i++ < 60000000) + if (i < 60000000) DELAY(1); #ifdef DDB else if (!db_active) diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index 2430804084df..153b5058e301 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -621,7 +621,7 @@ _mtx_lock_spin(struct mtx *m, int opts, const char *file, int line) while (m->mtx_lock != MTX_UNOWNED) { if (i++ < 10000000) continue; - if (i++ < 60000000) + if (i < 60000000) DELAY(1); #ifdef DDB else if (!db_active)