[asterisk-commits] russell: branch 1.4 r96024 - /branches/1.4/pbx/pbx_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 2 16:14:28 CST 2008


Author: russell
Date: Wed Jan  2 16:14:28 2008
New Revision: 96024

URL: http://svn.digium.com/view/asterisk?view=rev&rev=96024
Log:
Convert locks of the contexts list in pbx_config to the appropriate rdlock or wrlock

Modified:
    branches/1.4/pbx/pbx_config.c

Modified: branches/1.4/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_config.c?view=diff&rev=96024&r1=96023&r2=96024
==============================================================================
--- branches/1.4/pbx/pbx_config.c (original)
+++ branches/1.4/pbx/pbx_config.c Wed Jan  2 16:14:28 2008
@@ -236,7 +236,7 @@
 	struct ast_context *c = NULL;
 
 	if (pos == 2) {		/* "dont include _X_" */
-		if (ast_lock_contexts()) {
+		if (ast_wrlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			return NULL;
 		}
@@ -288,7 +288,7 @@
 		}
 		strsep(&dupline, " ");
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock contexts list\n");
 			free(context);
 			return NULL;
@@ -324,7 +324,7 @@
 			return NULL;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			free(context);
 			return NULL;
@@ -357,7 +357,7 @@
 	struct ast_context *c = NULL;
 
 	if (pos == 3) {		/* "dialplan remove include _X_" */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			return NULL;
 		}
@@ -409,7 +409,7 @@
 		}
 		strsep(&dupline, " ");
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock contexts list\n");
 			free(context);
 			return NULL;
@@ -445,7 +445,7 @@
 			return NULL;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			free(context);
 			return NULL;
@@ -687,7 +687,7 @@
 		le = strlen(exten);
 		lc = strlen(context);
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error2;
 		}
@@ -733,7 +733,7 @@
 		if (le == 0 || lc == 0)
 			goto error3;
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error3;
 		}
@@ -809,7 +809,7 @@
 		le = strlen(exten);
 		lc = strlen(context);
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error2;
 		}
@@ -855,7 +855,7 @@
 		if (le == 0 || lc == 0)
 			goto error3;
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error3;
 		}
@@ -999,7 +999,7 @@
 	int len = strlen(word);
 
 	if (pos == 2) {		/* 'include context _X_' (context) ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			return NULL;
 		}
@@ -1026,7 +1026,7 @@
 		strsep(&dupline, " ");
 
 		/* check for context existence ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			/* our fault, we can't check, so complete 'in' ... */
 			ret = strdup("in");
@@ -1055,7 +1055,7 @@
 			goto error3;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error3;
 		}
@@ -1094,7 +1094,7 @@
 	int len = strlen(word);
 
 	if (pos == 3) {		/* 'dialplan add include _X_' (context) ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			return NULL;
 		}
@@ -1121,7 +1121,7 @@
 		strsep(&dupline, " ");
 
 		/* check for context existence ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			/* our fault, we can't check, so complete 'into' ... */
 			ret = strdup("into");
@@ -1150,7 +1150,7 @@
 			goto error3;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock context list\n");
 			goto error3;
 		}
@@ -1233,7 +1233,7 @@
 	cfg = ast_config_load("extensions.conf");
 
 	/* try to lock contexts list */
-	if (ast_lock_contexts()) {
+	if (ast_rdlock_contexts()) {
 		ast_cli(fd, "Failed to lock contexts list\n");
 		ast_mutex_unlock(&save_dialplan_lock);
 		ast_config_destroy(cfg);
@@ -1615,7 +1615,7 @@
 		char *res = NULL;
 
 		/* try to lock contexts list ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -1644,7 +1644,7 @@
 		char *res = NULL;
 
 		/* try to lock contexts list ... */
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -1766,7 +1766,7 @@
 		}
 		ignorepat = strsep(&dupline, " ");
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -1815,7 +1815,7 @@
 		}
 		ignorepat = strsep(&dupline, " ");
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_ERROR, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -1917,7 +1917,7 @@
 
 	if (pos == 2) {
 		int len = strlen(word);
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -1967,7 +1967,7 @@
 			return NULL;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			free(dupline);
 			return NULL;
@@ -1999,7 +1999,7 @@
 
 	if (pos == 3) {
 		int len = strlen(word);
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			return NULL;
 		}
@@ -2049,7 +2049,7 @@
 			return NULL;
 		}
 
-		if (ast_lock_contexts()) {
+		if (ast_rdlock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
 			free(dupline);
 			return NULL;




More information about the asterisk-commits mailing list