summaryrefslogtreecommitdiff
path: root/ext/opcache/ZendAccelerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/ZendAccelerator.c')
-rw-r--r--ext/opcache/ZendAccelerator.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 1562922424..58016ce191 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1570,7 +1570,9 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
/* check blacklist right after ensuring that file was opened */
if (file_handle->opened_path && zend_accel_blacklist_is_blacklisted(&accel_blacklist, ZSTR_VAL(file_handle->opened_path))) {
+ SHM_UNPROTECT();
ZCSG(blacklist_misses)++;
+ SHM_PROTECT();
*op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
@@ -1601,7 +1603,9 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
}
if (ZCG(accel_directives).max_file_size > 0 && size > (size_t)ZCG(accel_directives).max_file_size) {
+ SHM_UNPROTECT();
ZCSG(blacklist_misses)++;
+ SHM_PROTECT();
*op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
@@ -2003,11 +2007,16 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
return accelerator_orig_compile_file(file_handle, type);
}
+ SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+ persistent_script = opcache_compile_file(file_handle, type, key, &op_array);
+ HANDLE_BLOCK_INTERRUPTIONS();
+ SHM_UNPROTECT();
+
/* Try and cache the script and assume that it is returned from_shared_memory.
* If it isn't compile_and_cache_file() changes the flag to 0
*/
from_shared_memory = 0;
- persistent_script = opcache_compile_file(file_handle, type, key, &op_array);
if (persistent_script) {
persistent_script = cache_script_in_shared_memory(persistent_script, key, key ? key_length : 0, &from_shared_memory);
}