diff options
author | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:18 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-07-19 11:28:18 -0300 |
commit | a3c20a378f7a9fa76e9301a43ac64ed07057d01e (patch) | |
tree | d14045c61b471f327f487431e05b0c4fe0cd8d76 /sys/kern/kern_mutex.c | |
parent | 3a4027cfafa37c1a0c0b05987c0edb1452c7bd2b (diff) | |
parent | 3f1f4f0e73b6d12c01e8cad4791d23e8e56127db (diff) | |
download | FreeBSD-src-a3c20a378f7a9fa76e9301a43ac64ed07057d01e.zip FreeBSD-src-a3c20a378f7a9fa76e9301a43ac64ed07057d01e.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
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); |