fix build hangs

This commit is contained in:
2026-02-18 19:41:59 -06:00
parent 6bc9dd53a7
commit 02eb58772c
2 changed files with 25 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
#include "cell.h"
#include "cell_internal.h"
#include <sys/stat.h>
#include <sys/types.h>
@@ -306,7 +307,18 @@ static JSValue js_os_rusage(JSContext *js, JSValue self, int argc, JSValue *argv
JSC_SCALL(os_system,
int err = system(str);
ret = number2js(js,err);
/* Reset actor turn timer after blocking system() call.
The scheduler's kill timer may have fired while system() blocked,
setting pause_flag = 2. Bump turn_gen so stale timer events are
ignored, and clear the pause flag so the VM doesn't raise
"interrupted" on the next backward branch. */
cell_rt *crt = JS_GetContextOpaque(js);
if (crt) {
atomic_fetch_add_explicit(&crt->turn_gen, 1, memory_order_relaxed);
JS_SetPauseFlag(js, 0);
crt->turn_start_ns = cell_ns();
}
ret = number2js(js, err);
)
JSC_CCALL(os_exit,