Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 2010 09:18:27 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209197 - head/sys/sys
Message-ID:  <201006150918.o5F9IRcS033506@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Jun 15 09:18:27 2010
New Revision: 209197
URL: http://svn.freebsd.org/changeset/base/209197

Log:
  Add assert to check that the (current) thread is in critical section.
  
  MFC after:	1 month

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Tue Jun 15 09:12:31 2010	(r209196)
+++ head/sys/sys/proc.h	Tue Jun 15 09:18:27 2010	(r209197)
@@ -325,6 +325,9 @@ do {									\
 #define	THREAD_LOCKPTR_ASSERT(td, lock)
 #endif
 
+#define	CRITSECT_ASSERT(td)						\
+    KASSERT((td)->td_critnest >= 1, ("Not in critical section"));
+
 /*
  * Flags kept in td_flags:
  * To change these you MUST have the scheduler lock.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006150918.o5F9IRcS033506>