aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-30 16:05:08 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-30 16:05:08 +0000
commitee8946ab17c559fab0242fe7370878858b899a30 (patch)
tree5fd8dcf82f86be438504befeb197c1453f777130 /include/asterisk/lock.h
parent13f66b584fdc4c0c462171ad5352f2dd1ac2fec0 (diff)
Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE()
macro. This caused the lock to not actually be released, and as a result, not avoid deadlocks at all. This resolves the issues reported in the last while about Asterisk locking up all over the place (and most commonly, in chan_iax2). (closes issue #12927) (closes issue #12940) (closes issue #12925) (potentially closes others ...) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@126573 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/lock.h')
-rw-r--r--include/asterisk/lock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index 5b9664c55..3e684f838 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -712,9 +712,9 @@ static inline int __ast_cond_timedwait(const char *filename, int lineno, const c
#else /* !DEBUG_THREADS */
#define DEADLOCK_AVOIDANCE(lock) \
- ast_mutex_lock(lock); \
+ ast_mutex_unlock(lock); \
usleep(1); \
- ast_mutex_unlock(lock);
+ ast_mutex_lock(lock);
typedef pthread_mutex_t ast_mutex_t;