]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
loader: Add volatile to resource_being_loaded.
authorCorey Farrell <git@cfware.com>
Sun, 24 Dec 2017 04:51:13 +0000 (23:51 -0500)
committerCorey Farrell <git@cfware.com>
Sun, 24 Dec 2017 05:34:58 +0000 (00:34 -0500)
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

main/loader.c

index c18fb379fc7fac0e3d47b5f17ac5b2c4265a9daa..b9baf3e933828d629b34014b1c96349704ee7543 100644 (file)
@@ -202,7 +202,7 @@ static AST_DLLIST_HEAD_STATIC(reload_queue, reload_queue_item);
  *
  * This is protected by the module_list lock.
  */
-static struct ast_module *resource_being_loaded;
+static struct ast_module * volatile resource_being_loaded;
 
 /*!
  * \internal