summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-01-30 01:57:27 +0100
committerAnatol Belski <ab@php.net>2017-01-30 01:57:27 +0100
commit2a5a3104462ad9d46be9d74fa85be26793870ce6 (patch)
treea1215608e8c9197058cfcaf4d1afe99c0f8af4cb
parent1dab39b9aa0934e01d8ad1e91d0db3bbd20a1dbd (diff)
parent2b7e5468c9ace40fc96a3345d14af177cabcf613 (diff)
downloadphp-git-2a5a3104462ad9d46be9d74fa85be26793870ce6.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: fix system id initialization for multiple threads
-rw-r--r--ext/opcache/ZendAccelerator.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index d47953aed8..d3107c09b4 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))
@@ -2092,6 +2094,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;