diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-12 16:35:30 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-12 16:35:30 +0000 |
commit | 6adb3f0fcd96acf49691376358b63fdef6713cc0 (patch) | |
tree | 037f660525872697aaa93ca3309fa0c3328ba1d9 /include | |
parent | 9fcb18ba4435a47451fd4dc0f915d415d0a1845b (diff) |
Merged revisions 175121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r175121 | mmichelson | 2009-02-12 10:28:06 -0600 (Thu, 12 Feb 2009) | 11 lines
Make lock information for ao2_trylock be more useful and gnarly
Core show locks information involving an ao2_trylock did not
show the function that called ao2_trylock, but would instead
show ao2_trylock as the source of the lock. This is not useful
when trying to debug locking issues.
One bizarre note is that this logic is already in 1.4 but somehow
did not get merged to trunk or the 1.6.X branches.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@175123 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/astobj2.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index 3f5f5347b..1311b3fe8 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -478,7 +478,12 @@ int _ao2_unlock(void *a, const char *file, const char *func, int line, const cha * \param a A pointer to the object we want to lock. * \return 0 on success, other values on error. */ +#ifndef DEBUG_THREADS int ao2_trylock(void *a); +#else +#define ao2_trylock(a) _ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) +int _ao2_trylock(void *a, const char *file, const char *func, int line, const char *var); +#endif /*! \brief * Return the lock address of an object |