diff options
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r-- | sys/kern/kern_mutex.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index fb0b313..908f99a 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -658,8 +658,15 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line) i = 0; tid = (uintptr_t)curthread; - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED()) { + /* + * Ensure that spinlock sections are balanced even when the + * scheduler is stopped, since we may otherwise inadvertently + * re-enable interrupts while dumping core. + */ + spinlock_enter(); return; + } #ifdef KDTRACE_HOOKS spin_time -= lockstat_nsecs(&td->td_lock->lock_object); |