]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE()
authorRussell Bryant <russell@russellbryant.com>
Mon, 30 Jun 2008 16:05:08 +0000 (16:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 30 Jun 2008 16:05:08 +0000 (16:05 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@126573 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/lock.h

index 5b9664c55c6b42bae39c9afd10e30d9733c941a5..3e684f838ebc09c68f8521fc2e7545a82e92237d 100644 (file)
@@ -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;