]> 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)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 28 Dec 2017 02:14:19 +0000 (20:14 -0600)
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
(cherry picked from commit 92fb393cab7fbd164e299601e94909ba95a0116b)

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