mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Move locks in TSRM.c to prevent races
This commit is contained in:
commit
097c9271e1
1
NEWS
1
NEWS
@ -4,6 +4,7 @@ PHP NEWS
|
||||
|
||||
- Core:
|
||||
. Fixed bug GH-8310 (Registry settings are no longer recognized). (cmb)
|
||||
. Fixed potential race condition during resource ID allocation. (ryancaicse)
|
||||
|
||||
- Date:
|
||||
. Fixed bug GH-7752 (DateTimeZone::getTransitions() returns insufficient
|
||||
|
@ -288,9 +288,9 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
|
||||
tsrm_resource_type *_tmp;
|
||||
_tmp = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
|
||||
if (!_tmp) {
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource"));
|
||||
*rsrc_id = 0;
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
return 0;
|
||||
}
|
||||
resource_types_table = _tmp;
|
||||
@ -331,10 +331,10 @@ TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, siz
|
||||
|
||||
size = TSRM_ALIGNED_SIZE(size);
|
||||
if (tsrm_reserved_size - tsrm_reserved_pos < size) {
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate space for fast resource"));
|
||||
*rsrc_id = 0;
|
||||
*offset = 0;
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -346,9 +346,9 @@ TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, siz
|
||||
tsrm_resource_type *_tmp;
|
||||
_tmp = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
|
||||
if (!_tmp) {
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource"));
|
||||
*rsrc_id = 0;
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
return 0;
|
||||
}
|
||||
resource_types_table = _tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user