svn commit: r221675 - user/avg/xcpu/sys/sys

Andriy Gapon avg at FreeBSD.org
Mon May 9 07:03:02 UTC 2011


Author: avg
Date: Mon May  9 07:03:01 2011
New Revision: 221675
URL: http://svn.freebsd.org/changeset/base/221675

Log:
  add a macro to identify a panic thread
  
  the macro is placed into systm.h as all potential users of this macro
  should already include this header file

Modified:
  user/avg/xcpu/sys/sys/systm.h

Modified: user/avg/xcpu/sys/sys/systm.h
==============================================================================
--- user/avg/xcpu/sys/sys/systm.h	Mon May  9 07:01:19 2011	(r221674)
+++ user/avg/xcpu/sys/sys/systm.h	Mon May  9 07:03:01 2011	(r221675)
@@ -109,6 +109,15 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES
 	    ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg)
 
 /*
+ * If we have already panic'd and this is the thread that called
+ * panic(), then don't block on any mutexes but silently succeed.
+ * Otherwise, the kernel will deadlock since the scheduler isn't
+ * going to run the thread that holds the lock we need.
+ */
+#define	IS_PANIC_THREAD()	\
+	(panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0)
+
+/*
  * XXX the hints declarations are even more misplaced than most declarations
  * in this file, since they are needed in one file (per arch) and only used
  * in two files.


More information about the svn-src-user mailing list