summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2016-06-20 15:43:33 +0200
committerChristoph M. Becker <cmb@php.net>2016-06-20 15:43:33 +0200
commit5408d96716176e90c96ae844a35fcdfc82d2bb1c (patch)
tree10ebf4cfe58f1395fcd1d739a46d1cce7c6e89c1 /ext
parenta291d92067b4610aaf1eb96fa528c7cb316b4d60 (diff)
parentc622cc4446951044dbef419e3ad59fc90eebd3a1 (diff)
downloadphp-git-5408d96716176e90c96ae844a35fcdfc82d2bb1c.tar.gz
Merge branch 'master' of http://git.php.net/repository/php-src
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/ZendAccelerator.c21
-rw-r--r--ext/standard/array.c4
2 files changed, 21 insertions, 4 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 222935bad0..2f756b0844 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -989,6 +989,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
zend_string *str = accel_find_interned_string(cwd_str);
if (!str) {
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
zend_shared_alloc_lock();
str = accel_new_interned_string(zend_string_copy(cwd_str));
@@ -998,6 +999,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
}
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
if (str) {
char buf[32];
@@ -1029,6 +1031,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
zend_string *str = accel_find_interned_string(ZCG(include_path));
if (!str) {
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
zend_shared_alloc_lock();
str = accel_new_interned_string(zend_string_copy(ZCG(include_path)));
@@ -1037,6 +1040,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
}
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
if (str) {
char buf[32];
@@ -1134,6 +1138,7 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
if (force ||
!ZCG(accel_directives).validate_timestamps ||
do_validate_timestamps(persistent_script, &file_handle) == FAILURE) {
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
@@ -1148,6 +1153,7 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
}
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
}
@@ -1594,9 +1600,11 @@ zend_op_array *file_cache_compile_file(zend_file_handle *file_handle, int type)
}
}
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
persistent_script = zend_file_cache_script_load(file_handle);
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
if (persistent_script) {
/* see bug #15471 (old BTS) */
if (persistent_script->script.filename) {
@@ -1716,11 +1724,13 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
persistent_script = (zend_persistent_script *)bucket->data;
if (key && !persistent_script->corrupted) {
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
zend_shared_alloc_lock();
zend_accel_add_key(key, key_length, bucket);
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
}
}
@@ -1751,6 +1761,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
ZCG(counted) = 1;
}
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
/* If script is found then validate_timestamps if option is enabled */
@@ -1815,6 +1826,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
/* No memory left. Behave like without the Accelerator */
if (ZSMMG(memory_exhausted) || ZCSG(restart_pending)) {
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
return accelerator_orig_compile_file(file_handle, type);
}
@@ -1832,6 +1844,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
*/
if (!persistent_script) {
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
return op_array;
}
if (from_shared_memory) {
@@ -1885,6 +1898,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
persistent_script->dynamic_members.last_used = ZCG(request_time);
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
/* Fetch jit auto globals used in the script before execution */
if (persistent_script->ping_auto_globals_mask) {
@@ -1973,11 +1987,13 @@ static zend_string* persistent_zend_resolve_path(const char *filename, int filen
if (!persistent_script->corrupted) {
if (key) {
/* add another "key" for the same bucket */
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
zend_shared_alloc_lock();
zend_accel_add_key(key, key_length, bucket);
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
} else {
ZCG(key_len) = 0;
}
@@ -2058,6 +2074,7 @@ static void accel_activate(void)
}
#endif
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
if (ZCG(counted)) {
@@ -2114,6 +2131,7 @@ static void accel_activate(void)
}
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
if (ZCSG(last_restart_time) != ZCG(last_restart_time)) {
/* SHM was reinitialized. */
@@ -2755,6 +2773,7 @@ static int accel_startup(zend_extension *extension)
zend_shared_alloc_unlock();
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
#ifdef HAVE_OPCACHE_FILE_CACHE
} else if (!ZCG(accel_directives).file_cache) {
accel_startup_ok = 0;
@@ -2882,6 +2901,7 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason)
}
zend_accel_error(ACCEL_LOG_DEBUG, "Restart Scheduled!");
+ HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();
ZCSG(restart_pending) = 1;
ZCSG(restart_reason) = reason;
@@ -2894,6 +2914,7 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason)
ZCSG(force_restart_time) = 0;
}
SHM_PROTECT();
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
/* this is needed because on WIN32 lock is not decreased unless ZCG(counted) is set */
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 67aec057b8..40c093eff3 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2395,7 +2395,6 @@ static void php_array_data_shuffle(zval *array) /* {{{ */
}
}
}
- HANDLE_BLOCK_INTERRUPTIONS();
hash->nNumUsed = n_elems;
hash->nInternalPointer = 0;
@@ -2411,7 +2410,6 @@ static void php_array_data_shuffle(zval *array) /* {{{ */
if (!(hash->u.flags & HASH_FLAG_PACKED)) {
zend_hash_to_packed(hash);
}
- HANDLE_UNBLOCK_INTERRUPTIONS();
}
/* }}} */
@@ -4994,7 +4992,6 @@ PHP_FUNCTION(array_multisort)
zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare, (swap_func_t)array_bucket_p_sawp);
/* Restructure the arrays based on sorted indirect - this is mostly taken from zend_hash_sort() function. */
- HANDLE_BLOCK_INTERRUPTIONS();
for (i = 0; i < num_arrays; i++) {
int repack;
@@ -5018,7 +5015,6 @@ PHP_FUNCTION(array_multisort)
zend_hash_rehash(hash);
}
}
- HANDLE_UNBLOCK_INTERRUPTIONS();
/* Clean up. */
for (i = 0; i < array_size; i++) {