Date: Mon, 9 May 2011 07:03:01 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r221675 - user/avg/xcpu/sys/sys Message-ID: <201105090703.p49731wY080271@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105090703.p49731wY080271>