[php-src] master: Use C11 atomics for epoll_pwait2_available

From: Date: Tue, 29 Sep 2026 19:46:10 +0000
Subject: [php-src] master: Use C11 atomics for epoll_pwait2_available
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141733@lists.php.net to get a copy of this message
Author: Jakub Zelenka (bukka) Date: 2026-09-29T21:45:58+02:00 Commit: https://github.com/php/php-src/commit/a85fcf30ab6c66464e3e7f4b8ca500b2fc9221f2 Raw diff: https://github.com/php/php-src/commit/a85fcf30ab6c66464e3e7f4b8ca500b2fc9221f2.diff Use C11 atomics for epoll_pwait2_available Changed paths: M main/poll/poll_backend_epoll.c Diff: diff --git a/main/poll/poll_backend_epoll.c b/main/poll/poll_backend_epoll.c index 85660a9322fe..ef8d42435ec6 100644 --- a/main/poll/poll_backend_epoll.c +++ b/main/poll/poll_backend_epoll.c @@ -20,7 +20,7 @@ #ifdef HAVE_EPOLL_PWAIT2 /* Cleared when the running kernel returns ENOSYS */ -static zend_atomic_bool epoll_pwait2_available = ZEND_ATOMIC_BOOL_INITIALIZER(true); +static atomic_bool epoll_pwait2_available = true; #endif typedef struct epoll_backend_data { @@ -193,14 +193,14 @@ static int epoll_backend_wait( int nfds = 0; #ifdef HAVE_EPOLL_PWAIT2 - if (EXPECTED(zend_atomic_bool_load_ex(&epoll_pwait2_available))) { + if (EXPECTED(atomic_load(&epoll_pwait2_available))) { nfds = epoll_pwait2( backend_data->epoll_fd, backend_data->events, max_events, timeout, NULL); if (UNEXPECTED(nfds < 0 && (errno == ENOSYS || errno == ENOTSUP))) { - zend_atomic_bool_store_ex(&epoll_pwait2_available, false); + atomic_store(&epoll_pwait2_available, false); } } - if (UNEXPECTED(!zend_atomic_bool_load_ex(&epoll_pwait2_available))) + if (UNEXPECTED(!atomic_load(&epoll_pwait2_available))) #endif { int timeout_ms = php_poll_timespec_to_ms(timeout);

« previous php.cvs (#141733) next »