Skip to content

Commit 2b7e546

Browse files
committed
fix system id initialization for multiple threads
1 parent df16579 commit 2b7e546

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename,
118118
static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
119119
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
120120

121+
static void accel_gen_system_id(void);
122+
121123
#ifdef ZEND_WIN32
122124
# define INCREMENT(v) InterlockedIncrement64(&ZCSG(v))
123125
# define DECREMENT(v) InterlockedDecrement64(&ZCSG(v))
@@ -2078,6 +2080,11 @@ static void accel_activate(void)
20782080
ZCG(cwd_key_len) = 0;
20792081
ZCG(cwd_check) = 1;
20802082

2083+
#ifdef ZTS
2084+
/* TODO refactor to init this just once. */
2085+
accel_gen_system_id();
2086+
#endif
2087+
20812088
#ifdef HAVE_OPCACHE_FILE_CACHE
20822089
if (ZCG(accel_directives).file_cache_only) {
20832090
return;

0 commit comments

Comments
 (0)