From: Russell Bryant Date: Mon, 30 Jun 2008 16:07:25 +0000 (+0000) Subject: Merged revisions 126573 via svnmerge from X-Git-Tag: 1.6.2.0-beta1~1842 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f58a4f63af65afdd89d35d2249011e86233dda9;p=thirdparty%2Fasterisk.git Merged revisions 126573 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r126573 | russell | 2008-06-30 11:05:08 -0500 (Mon, 30 Jun 2008) | 10 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@126574 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index 475e49a998..33af564058 100644 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -1469,14 +1469,14 @@ static inline int _ast_rwlock_trywrlock(ast_rwlock_t *t, const char *name, #else /* !DEBUG_THREADS */ #define CHANNEL_DEADLOCK_AVOIDANCE(chan) \ - ast_channel_lock(chan); \ + ast_channel_unlock(chan); \ usleep(1); \ - ast_channel_unlock(chan); + ast_channel_lock(chan); #define DEADLOCK_AVOIDANCE(lock) \ - ast_mutex_lock(lock); \ + ast_mutex_unlock(lock); \ usleep(1); \ - ast_mutex_unlock(lock); + ast_mutex_lock(lock); #define DLA_UNLOCK(lock) ast_mutex_unlock(lock)