diff options
author | Anatol Belski <ab@php.net> | 2017-01-30 01:54:36 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-01-30 01:54:36 +0100 |
commit | 2b7e5468c9ace40fc96a3345d14af177cabcf613 (patch) | |
tree | 6287e2f2781d8c0ed12ef8c2afb990b32403419e | |
parent | df16579642217708778e6917ce7c01cb9748df2e (diff) | |
download | php-git-2b7e5468c9ace40fc96a3345d14af177cabcf613.tar.gz |
fix system id initialization for multiple threads
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 8e3bbade59..3baeebaece 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; |