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

Jenkins2 asteriskteam at digium.com
Tue Feb 20 05:57:53 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8256 )

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(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/main/config.c b/main/config.c
index d022b6a..3b56c03 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2841,8 +2841,6 @@
 {
 	struct ast_config_map *map;
 
-	SCOPED_MUTEX(lock, &config_lock);
-
 	while (config_maps) {
 		map = config_maps;
 		config_maps = config_maps->next;
@@ -2896,6 +2894,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/8256
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I378316bad04f1b599ea82d0fef62b8978a644b92
Gerrit-Change-Number: 8256
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180220/65e1ca5b/attachment.html>


More information about the asterisk-code-review mailing list