pthread_mutexattr_settype(&mutex_attr, type);\
pthread_mutex_init(&var, &mutex_attr); \
}
+#ifdef ENABLE_MUTEX_DEBUG
+#include "mutexDebug.h"
+#define SYNCHRONIZE(var) xmutex(1, &var, __FILE__, __LINE__); pthread_mutex_lock(&var)
+#define DESYNCHRONIZE(var) xmutex(0, &var, __FILE__, __LINE__); pthread_mutex_unlock(&var)
+#else
#define SYNCHRONIZE(var) pthread_mutex_lock(&var)
-#define SET_SYNCHRONIZE(var) pthread_mutex_trylock(&var)
#define DESYNCHRONIZE(var) pthread_mutex_unlock(&var)
+#endif
#else
#define THREAD_MUTEX_INIT(var)
#define SYNCHRONIZE(var)
#define DESYNCHRONIZE(var)
+#ifdef ENABLE_MUTEX_DEBUG
+#undef ENABLE_MUTEX_DEBUG
+#endif
#endif
#if __GNUC__