Skip to content

Commit 97beffe

Browse files
committed
* fix static zend_always_inline int _php_poll2_async(php_pollfd *ufds, unsigned int nfds, int timeout)
add timeout > 0 Use context switching only if a timeout is specified.
1 parent e5956e2 commit 97beffe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/php_network.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ ZEND_API extern int php_poll2_async(php_pollfd *ufds, unsigned int nfds, const i
168168

169169
static zend_always_inline int _php_poll2_async(php_pollfd *ufds, unsigned int nfds, int timeout)
170170
{
171-
if(UNEXPECTED(ZEND_ASYNC_IS_ACTIVE)) {
171+
// Use context switching only if a timeout is specified.
172+
if(UNEXPECTED(timeout > 0 && ZEND_ASYNC_IS_ACTIVE)) {
172173
return php_poll2_async(ufds, nfds, timeout);
173174
} else {
174175
return poll(ufds, nfds, timeout);

0 commit comments

Comments
 (0)