fix build hangs
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user