mono-threads-debug.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * \file
  3. */
  4. #ifndef __MONO_UTILS_MONO_THREADS_DEBUG_H__
  5. #define __MONO_UTILS_MONO_THREADS_DEBUG_H__
  6. #include <config.h>
  7. #include <glib.h>
  8. /* Logging - enable them below if you need specific logging for the category you need */
  9. #define MOSTLY_ASYNC_SAFE_FPRINTF(handle, ...) do { \
  10. g_async_safe_fprintf (handle, __VA_ARGS__); \
  11. } while (0)
  12. #define MOSTLY_ASYNC_SAFE_PRINTF(...) MOSTLY_ASYNC_SAFE_FPRINTF(1, __VA_ARGS__);
  13. #if 1
  14. #define THREADS_DEBUG(...)
  15. #else
  16. #define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
  17. #endif
  18. #if 1
  19. #define THREADS_STW_DEBUG(...)
  20. #else
  21. #define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
  22. #endif
  23. #if 1
  24. #define THREADS_SUSPEND_DEBUG(...)
  25. #else
  26. #define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
  27. #endif
  28. #if 1
  29. #define THREADS_STATE_MACHINE_DEBUG(...)
  30. #else
  31. #define THREADS_STATE_MACHINE_DEBUG_ENABLED
  32. #define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
  33. #endif
  34. #if 1
  35. #define THREADS_INTERRUPT_DEBUG(...)
  36. #else
  37. #define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
  38. #endif
  39. #endif /* __MONO_UTILS_MONO_THREADS_DEBUG_H__ */