[Asterisk-code-review] res musiconhold: Prevent multiple simultaneous reloads. (asterisk[13])

Sean Bright asteriskteam at digium.com
Mon Jan 11 16:24:09 CST 2016


Sean Bright has uploaded a new change for review.

  https://gerrit.asterisk.org/1989

Change subject: res_musiconhold: Prevent multiple simultaneous reloads.
......................................................................

res_musiconhold: Prevent multiple simultaneous reloads.

There are two ways in which the reload() function in res_musiconhold can be
called from the CLI:

  * module reload res_musiconhold.so
  * moh reload

In the former case, the module loader holds a lock that prevents multiple
concurrent calls, but in the latter there is no such protection.

This patch changes the 'moh reload' CLI command to invoke the module loader
directly, rather than call reload() explicitly.

Change-Id: Ifae05eedafbcc972854eb478e3fba278561a0f67
---
M res/res_musiconhold.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/89/1989/1

diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 2ac5081..669fb9b 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -1821,7 +1821,8 @@
 	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 
-	reload();
+	/* The module loader will prevent concurrent reloads from occurring, so we delegate */
+	ast_module_reload("res_musiconhold");
 
 	return CLI_SUCCESS;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifae05eedafbcc972854eb478e3fba278561a0f67
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list