const char *tdm_mutex_unlock_func;
int tdm_mutex_unlock_line;
+pthread_mutex_t tdm_debug_mutex_check_lock = PTHREAD_MUTEX_INITIALIZER;
+const char *tdm_debug_mutex_lock_func;
+int tdm_debug_mutex_lock_line;
+
/* LCOV_EXCL_START */
static tdm_private_layer *
_tdm_display_find_private_layer(tdm_private_output *private_output,
#define tdm_display_unlock(dpy) _pthread_mutex_unlock(&((tdm_private_display *)dpy)->lock)
+/* debugging mutex ************************************************************/
+extern pthread_mutex_t tdm_debug_mutex_check_lock;
+extern const char *tdm_debug_mutex_lock_func;
+extern int tdm_debug_mutex_lock_line;
+
+#define _debug_pthread_mutex_lock(l) \
+ do { \
+ pthread_mutex_lock(l); \
+ pthread_mutex_lock(&tdm_debug_mutex_check_lock); \
+ tdm_debug_mutex_lock_func = __FUNCTION__; \
+ tdm_debug_mutex_lock_line = __LINE__; \
+ pthread_mutex_unlock(&tdm_debug_mutex_check_lock); \
+ } while (0)
+
+#define _debug_pthread_mutex_unlock(l) \
+ do { \
+ pthread_mutex_lock(&tdm_debug_mutex_check_lock); \
+ tdm_debug_mutex_lock_func = NULL; \
+ tdm_debug_mutex_lock_line = 0; \
+ pthread_mutex_unlock(&tdm_debug_mutex_check_lock); \
+ pthread_mutex_unlock(l); \
+ } while (0)
+
#ifdef __cplusplus
}
#endif