Add ao2_trylock() to go along with ao2_lock() and ao2_unlock()

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-11-25 17:34:50 +00:00
parent e8f9274ca7
commit 07741a3261
2 changed files with 34 additions and 0 deletions

View File

@@ -192,6 +192,13 @@ int ao2_lock(void *a);
int _ao2_lock(void *a, const char *file, const char *func, int line, const char *var);
#endif
#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
/*!
* Unlock an object.
*