aboutsummaryrefslogtreecommitdiffstats
path: root/main/astobj2.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 21dc92733..8e33f94ae 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -188,14 +188,23 @@ int _ao2_unlock(void *user_data, const char *file, const char *func, int line, c
#endif
}
+#ifndef DEBUG_THREADS
int ao2_trylock(void *user_data)
+#else
+int _ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var)
+#endif
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
int ret;
if (p == NULL)
return -1;
- ret = ast_mutex_trylock(&p->priv_data.lock);
+#ifndef DEBUG_THREADS
+ ret = ast_mutex_trylock(&p->priv_data.lock);
+#else
+ ret = __ast_pthread_mutex_trylock(file, line, func, var, &p->priv_data.lock);
+#endif
+
#ifdef AO2_DEBUG
if (!ret)
ast_atomic_fetchadd_int(&ao2.total_locked, 1);