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.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to