backport 262160e and 2d55e8c into 5.6

This commit is contained in:
Anatol Belski 2015-10-20 20:05:44 +02:00
parent d5f76caf6c
commit ccc95bf9df

View File

@ -205,14 +205,19 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
err = GetLastError();
if (ret == ALLOC_FAIL_MAPPING) {
/* Mapping failed, wait for mapping object to get freed and retry */
CloseHandle(memfile);
CloseHandle(memfile);
memfile = NULL;
if (++map_retries >= MAX_MAP_RETRIES) {
break;
}
zend_shared_alloc_unlock_win32();
Sleep(1000 * (map_retries + 1));
zend_shared_alloc_lock_win32();
} else {
zend_shared_alloc_unlock_win32();
return ret;
}
} while (++map_retries < MAX_MAP_RETRIES);
} while (1);
if (map_retries == MAX_MAP_RETRIES) {
zend_shared_alloc_unlock_win32();