8000 backport 262160e and 2d55e8c into 5.6 · php/php-src@ccc95bf · GitHub
[go: up one dir, main page]

Skip to content

Commit ccc95bf

Browse files
committed
backport 262160e and 2d55e8c into 5.6
1 parent d5f76ca commit ccc95bf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/opcache/shared_alloc_win32.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,19 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
205205
err = GetLastError();
206206
if (ret == ALLOC_FAIL_MAPPING) {
207207
/* Mapping failed, wait for mapping object to get freed and retry */
208-
CloseHandle(memfile);
208+
CloseHandle(memfile);
209209
memfile = NULL;
210+
if (++map_retries >= MAX_MAP_RETRIES) {
211+
break;
212+
}
213+
zend_shared_alloc_unlock_win32();
210214
Sleep(1000 * (map_retries + 1));
215+
zend_shared_alloc_lock_win32();
211216
} else {
212217
zend_shared_alloc_unlock_win32();
213218
return ret;
214219
}
215-
} while (++map_retries < MAX_MAP_RETRIES);
220+
} while (1);
216221

217222
if (map_retries == MAX_MAP_RETRIES) {
218223
zend_shared_alloc_unlock_win32();

0 commit comments

Comments
 (0)
0