X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fdebug.h;h=02b2481df14e100c193eee1999d1002f4f78271d;hp=eee6d44dcab0e04929b5d61cb4806a66ed17ea5b;hb=44bd65fe60fb83fa4c3bbb0d4c679d2b70a096df;hpb=cd0567b4052ee24259bc6b8a9858af9d26f3de48;ds=sidebyside diff --git a/src/debug.h b/src/debug.h index eee6d44..02b2481 100644 --- 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_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)); \