Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 3513bba3 authored by Deucе's avatar Deucе 👌🏾

Keep running the event loop while the run queue is not empty

Previously, timed or polled callbacks were required to keep the
event loop running.
parent 97c2ab4d
Pipeline #1836 passed with stage
in 9 minutes and 28 seconds
......@@ -1134,7 +1134,7 @@ js_handle_events(JSContext *cx, js_callback_t *cb, volatile int *terminated)
if (!cb->events_supported)
return JS_FALSE;
while (cb->keepGoing && !JS_IsExceptionPending(cx) && cb->events && !*terminated) {
while (cb->keepGoing && !JS_IsExceptionPending(cx) && (cb->events || cb->rq_head) && !*terminated) {
timeout = -1; // Infinity by default...
now = (uint64_t)(xp_timer() * 1000);
ev = NULL;
......@@ -1147,7 +1147,7 @@ js_handle_events(JSContext *cx, js_callback_t *cb, volatile int *terminated)
#else
hsock = 0;
#endif
#ifdef PREFER_POLL
for (ev = *head; ev; ev = ev->next) {
if (ev->type == JS_EVENT_SOCKET_READABLE || ev->type == JS_EVENT_SOCKET_READABLE_ONCE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment