You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
When looking at this code with @codebytere for us to make a PR to propose upstream, we found a couple of things that we weren't sure about and would like another opinion on:
But through the call chain of uv_loop_init() -> uv_async_init() -> uv__async_start() -> uv__io_start(), any loop already has an async watcher on it as soon as it's initialized. So if I'm reading this right, the callback will never be triggered for the async watcher because we'll never have an empty queue and a non-NULLon_queue_watcher_updated
One of the callback triggers doesn't look like the others. uv__io_feed() pumps it unconditionally, regardless of whether the loop->watcher_queue changes:
voiduv__io_feed(uv_loop_t*loop, uv__io_t*w) {
if (QUEUE_EMPTY(&w->pending_queue))
QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
if (loop->on_watcher_queue_updated)
loop->on_watcher_queue_updated(loop);
}
Are these intentional? If so, could you walk us through it so that we can better understand this code?