[Asterisk-code-review] config: Fix locking for extconfig reload. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Mon Feb 19 03:09:03 CST 2018


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/8258


Change subject: config: Fix locking for extconfig reload.
......................................................................

config: Fix locking for extconfig reload.

Expand locking to include full reload process for extconfig to ensure
nothing can read the config mappings between clearing and reloading.

Change-Id: I378316bad04f1b599ea82d0fef62b8978a644b92
---
M main/config.c
1 file changed, 1 insertion(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/58/8258/1

diff --git a/main/config.c b/main/config.c
index 3fbbacf..118b958 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2839,8 +2839,6 @@
 {
 	struct ast_config_map *map;
 
-	SCOPED_MUTEX(lock, &config_lock);
-
 	while (config_maps) {
 		map = config_maps;
 		config_maps = config_maps->next;
@@ -2894,6 +2892,7 @@
 	char *driver, *table, *database, *textpri, *stringp, *tmp;
 	struct ast_flags flags = { CONFIG_FLAG_NOREALTIME };
 	int pri;
+	SCOPED_MUTEX(lock, &config_lock);
 
 	clear_config_maps();
 

-- 
To view, visit https://gerrit.asterisk.org/8258
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I378316bad04f1b599ea82d0fef62b8978a644b92
Gerrit-Change-Number: 8258
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180219/e5a297dc/attachment.html>


More information about the asterisk-code-review mailing list