[asterisk-commits] russell: branch 1.4 r151905 - /branches/1.4/main/asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 25 05:59:04 CDT 2008


Author: russell
Date: Sat Oct 25 05:59:02 2008
New Revision: 151905

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151905
Log:
Move AMI initialization to occur after loading modules.  This prevents a
deadlock when someone tries to initiate a module reload from the AMI just
as Asterisk is starting.

(closes issue #13778)
Reported by: hotsblanc
Fix suggested by hotsblanc

Modified:
    branches/1.4/main/asterisk.c

Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?view=diff&rev=151905&r1=151904&r2=151905
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Sat Oct 25 05:59:02 2008
@@ -3061,11 +3061,6 @@
 
 	ast_channels_init();
 
-	if (init_manager()) {
-		printf(term_quit());
-		exit(1);
-	}
-
 	if (ast_cdr_engine_init()) {
 		printf(term_quit());
 		exit(1);
@@ -3111,6 +3106,15 @@
 	}
 
 	if (load_modules(0)) {
+		printf(term_quit());
+		exit(1);
+	}
+
+	/* AMI is initialized after loading modules because of a potential
+	 * conflict between issuing a module reload from manager and
+	 * registering manager actions.  This will cause reversed locking
+	 * order between the module list and manager actions list. */
+	if (init_manager()) {
 		printf(term_quit());
 		exit(1);
 	}




More information about the asterisk-commits mailing list