com php-src: fix system id initialization for multiple threads: ext/opcache/ZendAccelerator.c

From: Date: Mon, 30 Jan 2017 00:54:36 +0000
Subject: com php-src: fix system id initialization for multiple threads: ext/opcache/ZendAccelerator.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96902@lists.php.net to get a copy of this message
Commit: 2b7e5468c9ace40fc96a3345d14af177cabcf613 Author: Anatol Belski <ab@php.net> Mon, 30 Jan 2017 01:54:36 +0100 Parents: df16579642217708778e6917ce7c01cb9748df2e Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2b7e5468c9ace40fc96a3345d14af177cabcf613 Log: fix system id initialization for multiple threads Changed paths: M ext/opcache/ZendAccelerator.c Diff: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 8e3bbad..3baeeba 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -118,6 +118,8 @@ static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename, static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL; static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL; +static void accel_gen_system_id(void); + #ifdef ZEND_WIN32 # define INCREMENT(v) InterlockedIncrement64(&ZCSG(v)) # define DECREMENT(v) InterlockedDecrement64(&ZCSG(v)) @@ -2078,6 +2080,11 @@ static void accel_activate(void) ZCG(cwd_key_len) = 0; ZCG(cwd_check) = 1; +#ifdef ZTS + /* TODO refactor to init this just once. */ + accel_gen_system_id(); +#endif + #ifdef HAVE_OPCACHE_FILE_CACHE if (ZCG(accel_directives).file_cache_only) { return;

« previous php.cvs (#96902) next »