projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
update readme
[m6w6/ext-psi]
/
src
/
debug.h
diff --git
a/src/debug.h
b/src/debug.h
index eee6d44dcab0e04929b5d61cb4806a66ed17ea5b..02b2481df14e100c193eee1999d1002f4f78271d 100644
(file)
--- a/
src/debug.h
+++ b/
src/debug.h
@@
-39,6
+39,14
@@
void psi_debug_unlock(struct psi_data *data);
# define psi_debug_unlock(ctx)
#endif
# define psi_debug_unlock(ctx)
#endif
+#define PSI_DEBUG_LOCK(ctx, group_actions) do { \
+ if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
+ psi_debug_lock(PSI_DATA(ctx)); \
+ group_actions; \
+ psi_debug_unlock(PSI_DATA(ctx)); \
+ } \
+} while(0)
+
#define PSI_DEBUG_PRINT(ctx, ...) do { \
if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
psi_debug_lock(PSI_DATA(ctx)); \
#define PSI_DEBUG_PRINT(ctx, ...) do { \
if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
psi_debug_lock(PSI_DATA(ctx)); \