aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-30 16:16:49 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-30 16:16:49 +0000
commita65b6c05c866c36c220563224918825c11f8a3dd (patch)
tree87c543e1b1abd94af2dc295a914e32fca02e423b
parent138d65ccacea607b9fa8926758c6578e548ac800 (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/tags/1.4.21.1@126578 f38db490-d61c-443f-a65b-d21fe96a405b
-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 eae56f4cd..53dda2127 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;