summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-07-19 11:28:18 -0300
committerRenato Botelho <renato@netgate.com>2016-07-19 11:28:18 -0300
commita3c20a378f7a9fa76e9301a43ac64ed07057d01e (patch)
treed14045c61b471f327f487431e05b0c4fe0cd8d76 /sys/kern/kern_mutex.c
parent3a4027cfafa37c1a0c0b05987c0edb1452c7bd2b (diff)
parent3f1f4f0e73b6d12c01e8cad4791d23e8e56127db (diff)
downloadFreeBSD-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.c9
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);
OpenPOWER on IntegriCloud