unix: check watcher queue in uv_backend_timeout()#1568
Conversation
Return 0 in uv_backend_timeout() if the watcher queue is not empty.
|
I've read #1565 but I don't understand why this is necessary.
Why should |
|
When new file descriptors will be added you need to call uv_run again without blocking. Otherwise you can't get notified of new events (through uv_backend_fd). For example, consider the following main loop: Consider what happens if you call uv_read_start() from within a uv callback. Now you really need to call uv_run() again immediately (hence why you should return 0 from uv_backend_timeout). |
|
Sorry for the delay, the notification got buried in my inbox. Okay, I see what you mean now but this change as it stands would busy-loop on Solaris/Illumos because of these three lines. I don't care much about that platform but if we ever added a What might work is to claim a bit in It's not completely watertight because all watchers might get stopped again before |
|
This PR hasn't seen action in almost two years so I'll take the liberty of closing it out. |
Return 0 in uv_backend_timeout() if the watcher queue is not empty.
See issue #1565.