summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index bf157eb..bbfac1b 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -690,12 +690,18 @@ _mtx_lock_spin(struct mtx *m, int opts, const char *file, int line)
if (i < 60000000)
DELAY(1);
#ifdef DDB
- else if (!db_active)
+ else if (!db_active) {
#else
- else
+ else {
#endif
- panic("spin lock %s held by %p for > 5 seconds",
+ printf("spin lock %s held by %p for > 5 seconds\n",
m->mtx_object.lo_name, (void *)m->mtx_lock);
+#ifdef WITNESS
+ witness_display_spinlock(&m->mtx_object,
+ mtx_owner(m));
+#endif
+ panic("spin lock held too long");
+ }
#ifdef __i386__
ia32_pause();
#endif
OpenPOWER on IntegriCloud