diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_mutex.c | 5 | ||||
-rw-r--r-- | sys/kern/subr_turnstile.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index f9b7413..d0fc8c9 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -536,9 +536,12 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line) owner = (struct thread *)(v & MTX_FLAGMASK); if (m != &Giant && thread_runnable(owner)) { mtx_unlock_spin(&sched_lock); + while (mtx_owner(m) == owner && + thread_runnable(owner)) { #ifdef __i386__ - ia32_pause(); + ia32_pause(); #endif + } continue; } #endif /* SMP && ADAPTIVE_MUTEXES */ diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index f9b7413..d0fc8c9 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -536,9 +536,12 @@ _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line) owner = (struct thread *)(v & MTX_FLAGMASK); if (m != &Giant && thread_runnable(owner)) { mtx_unlock_spin(&sched_lock); + while (mtx_owner(m) == owner && + thread_runnable(owner)) { #ifdef __i386__ - ia32_pause(); + ia32_pause(); #endif + } continue; } #endif /* SMP && ADAPTIVE_MUTEXES */ |