nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
debug.h
Go to the documentation of this file.
1 extern int dbg_printf(const char *format, ...);
2 
3 #if defined(NDEBUG)
4  #define NEED_LOCK_TEST_BEGIN
5  #define NEED_LOCK_TEST_END
6 #else
7  #define NEED_LOCK_TEST_BEGIN \
8  static int __need_lock = 0; \
9  if (__need_lock) { \
10  dbg_printf("[%s:%d] need_lock <<<<<<<<<<<<<\n", __func__, __LINE__); \
11  while (1) { \
12  } \
13  } \
14  __need_lock = 1;
15 
16 
17  #define NEED_LOCK_TEST_END \
18  __need_lock = 0;
19 #endif