From: Corey Farrell Date: Sun, 24 Dec 2017 04:51:13 +0000 (-0500) Subject: loader: Add volatile to resource_being_loaded. X-Git-Tag: 16.0.0-rc1~486 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23aa20bf209dbc02b01c757c5f5f1a787548ed96;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/loader.c b/main/loader.c index 8f65fb3c86..fe18048efc 100644 --- a/main/loader.c +++ b/main/loader.c @@ -198,7 +198,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