[svn-commits] tilghman: branch 1.4 r280982 - /branches/1.4/main/pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 5 02:28:38 CDT 2010


Author: tilghman
Date: Thu Aug  5 02:28:33 2010
New Revision: 280982

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=280982
Log:
Change context lock back to a mutex, because functionality depends upon the lock being recursive.

(closes issue #17643)
 Reported by: zerohalo
 Patches: 
       20100726__issue17643.diff.txt uploaded by tilghman (license 14)
 Tested by: zerohalo

Modified:
    branches/1.4/main/pbx.c

Modified: branches/1.4/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/pbx.c?view=diff&rev=280982&r1=280981&r2=280982
==============================================================================
--- branches/1.4/main/pbx.c (original)
+++ branches/1.4/main/pbx.c Thu Aug  5 02:28:33 2010
@@ -492,7 +492,11 @@
 };
 
 static struct ast_context *contexts;
-AST_RWLOCK_DEFINE_STATIC(conlock); 		/*!< Lock for the ast_context list */
+/*!\brief Lock for the ast_context list
+ * This lock MUST be recursive, or a deadlock on reload may result.  See
+ * https://issues.asterisk.org/view.php?id=17643
+ */
+AST_MUTEX_DEFINE_STATIC(conlock);
 
 static AST_LIST_HEAD_STATIC(apps, ast_app);
 
@@ -6193,22 +6197,22 @@
  */
 int ast_lock_contexts()
 {
-	return ast_rwlock_wrlock(&conlock);
+	return ast_mutex_lock(&conlock);
 }
 
 int ast_rdlock_contexts(void)
 {
-	return ast_rwlock_rdlock(&conlock);
+	return ast_mutex_lock(&conlock);
 }
 
 int ast_wrlock_contexts(void)
 {
-	return ast_rwlock_wrlock(&conlock);
+	return ast_mutex_lock(&conlock);
 }
 
 int ast_unlock_contexts()
 {
-	return ast_rwlock_unlock(&conlock);
+	return ast_mutex_unlock(&conlock);
 }
 
 /*




More information about the svn-commits mailing list