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();