[Asterisk-code-review] loader: Add volatile to resource being loaded. (asterisk[15])

Corey Farrell asteriskteam at digium.com
Sat Dec 23 23:44:02 CST 2017


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


Change subject: loader: Add volatile to resource_being_loaded.
......................................................................

loader: Add volatile to resource_being_loaded.

Some compiler optimizers seem to assume that dlopen will not use
__attribute__((constructor)) functions to call back to the program.
This was causing resource_being_loaded to be optimized away completely.

ASTERISK-27531 #close
Tested By: abelbeck

Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9
---
M main/loader.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/7734/1

diff --git a/main/loader.c b/main/loader.c
index 2a203c6..a6a87a0 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -198,7 +198,7 @@
  *
  * This is protected by the module_list lock.
  */
-static struct ast_module *resource_being_loaded;
+static struct ast_module * volatile resource_being_loaded;
 
 /*!
  * \internal

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9
Gerrit-Change-Number: 7734
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/20171223/3ee8fb11/attachment.html>


More information about the asterisk-code-review mailing list