Skip to content
Snippets Groups Projects
Commit 3513bba3 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

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
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1836 passed
...@@ -1134,7 +1134,7 @@ js_handle_events(JSContext *cx, js_callback_t *cb, volatile int *terminated) ...@@ -1134,7 +1134,7 @@ js_handle_events(JSContext *cx, js_callback_t *cb, volatile int *terminated)
if (!cb->events_supported) if (!cb->events_supported)
return JS_FALSE; 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... timeout = -1; // Infinity by default...
now = (uint64_t)(xp_timer() * 1000); now = (uint64_t)(xp_timer() * 1000);
ev = NULL; ev = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment