]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Change context lock back to a mutex, because functionality depends upon the lock...
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 5 Aug 2010 07:28:33 +0000 (07:28 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 5 Aug 2010 07:28:33 +0000 (07:28 +0000)
(closes issue #17643)
 Reported by: zerohalo
 Patches:
       20100726__issue17643.diff.txt uploaded by tilghman (license 14)
 Tested by: zerohalo

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@280982 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 1ad2d2e1d7478135a87d5e3abc883197c447bb39..e88bdb879fd071697dddfcb1bb046f678d675b33 100644 (file)
@@ -492,7 +492,11 @@ static struct pbx_builtin {
 };
 
 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 load_pbx(void)
  */
 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);
 }
 
 /*