Add reentrance check. Put kernel debug switch together.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1494 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
mbbill@gmail.com
2011-06-12 10:01:48 +00:00
parent 8c3d1e5eae
commit 864bd11802
19 changed files with 434 additions and 221 deletions

View File

@@ -21,6 +21,7 @@
#define __RT_THREAD_H__
#include <rtdef.h>
#include <rtdebug.h>
#ifdef __cplusplus
extern "C" {
@@ -48,6 +49,24 @@ void rt_object_detach_sethook(void (*hook)(struct rt_object* object));
void rt_object_trytake_sethook(void (*hook)(struct rt_object* object));
void rt_object_take_sethook(void (*hook)(struct rt_object* object));
void rt_object_put_sethook(void (*hook)(struct rt_object* object));
#define RT_OBJECT_HOOK_CALL(hookfunc)\
do{\
register rt_base_t temp;\
temp = rt_hw_interrupt_disable();\
RT_DEBUG_REENT_IN\
if (hookfunc != RT_NULL) hookfunc();\
RT_DEBUG_REENT_OUT\
rt_hw_interrupt_enable(temp);\
}while(0)
#define RT_OBJECT_HOOK_CALL2(hookfunc,...)\
do{\
register rt_base_t temp;\
temp = rt_hw_interrupt_disable();\
RT_DEBUG_REENT_IN\
if (hookfunc != RT_NULL) hookfunc(__VA_ARGS__);\
RT_DEBUG_REENT_OUT\
rt_hw_interrupt_enable(temp);\
}while(0)
#endif
/*@}*/