diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-22 19:08:01 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-22 19:08:01 +0000 |
commit | 8d07966e391238ae14e24d143731ac4b4fd8d9c7 (patch) | |
tree | 7d5f10f305e5407fdfc584f251071ca5f299dda6 /main/astobj2.c | |
parent | 2b551e72e492fbdb71e3439bf15c50f88f0a3733 (diff) |
Remove ABI differences that occured when compiling with DEBUG_THREADS.
"Bad Things" would happen if Asterisk was compiled with DEBUG_THREADS, but a
loaded module was not (or vice versa). This also immensely simplifies the
lock code, since there are no longer 2 separate versions of them.
Review: https://reviewboard.asterisk.org/r/508/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258557 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astobj2.c')
-rw-r--r-- | main/astobj2.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/main/astobj2.c b/main/astobj2.c index 40efd0f2a..253395307 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -143,11 +143,7 @@ static void *internal_ao2_callback(struct ao2_container *c, char *tag, char *file, int line, const char *funcname); static void *internal_ao2_iterator_next(struct ao2_iterator *a, struct bucket_list **q); -#ifndef DEBUG_THREADS -int ao2_lock(void *user_data) -#else int __ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var) -#endif { struct astobj2 *p = INTERNAL_OBJ(user_data); @@ -158,18 +154,10 @@ int __ao2_lock(void *user_data, const char *file, const char *func, int line, co ast_atomic_fetchadd_int(&ao2.total_locked, 1); #endif -#ifndef DEBUG_THREADS - return ast_mutex_lock(&p->priv_data.lock); -#else return __ast_pthread_mutex_lock(file, line, func, var, &p->priv_data.lock); -#endif } -#ifndef DEBUG_THREADS -int ao2_unlock(void *user_data) -#else int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var) -#endif { struct astobj2 *p = INTERNAL_OBJ(user_data); @@ -180,29 +168,17 @@ int __ao2_unlock(void *user_data, const char *file, const char *func, int line, ast_atomic_fetchadd_int(&ao2.total_locked, -1); #endif -#ifndef DEBUG_THREADS - return ast_mutex_unlock(&p->priv_data.lock); -#else return __ast_pthread_mutex_unlock(file, line, func, var, &p->priv_data.lock); -#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; -#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) |