summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/config.h12
-rw-r--r--pjlib/include/pj/os.h6
2 files changed, 13 insertions, 5 deletions
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index b51a7585..0ae89972 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -329,6 +329,18 @@
#endif
/**
+ * Enable this macro to activate logging to mutex/semaphore related events.
+ * This is useful to troubleshoot concurrency problems such as deadlocks.
+ * In addition, you should also add PJ_LOG_HAS_THREAD_ID flag to the
+ * log decoration to assist the troubleshooting.
+ *
+ * Default: 0
+ */
+#ifndef PJ_DEBUG_MUTEX
+# define PJ_DEBUG_MUTEX 0
+#endif
+
+/**
* Expand functions in *_i.h header files as inline.
*
* Default: 0.
diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h
index 38eb8ea6..e1d3c485 100644
--- a/pjlib/include/pj/os.h
+++ b/pjlib/include/pj/os.h
@@ -675,11 +675,7 @@ PJ_DECL(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex);
* @param mutex The mutex.
* @return Non-zero if yes.
*/
-#if defined(PJ_DEBUG) && PJ_DEBUG != 0
- PJ_DECL(pj_bool_t) pj_mutex_is_locked(pj_mutex_t *mutex);
-#else
-# define pj_mutex_is_locked(mutex) 1
-#endif
+PJ_DECL(pj_bool_t) pj_mutex_is_locked(pj_mutex_t *mutex);
/**
* @}