From dd6c14dc359ef9b3fcdd79a41a62d5a3ce55e80f Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 7 Apr 2023 09:48:52 +0100 Subject: [PATCH] Exit immediately on second ctrl-c --- src/jit/jit-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jit/jit-core.c b/src/jit/jit-core.c index 4e996788..0da813d9 100644 --- a/src/jit/jit-core.c +++ b/src/jit/jit-core.c @@ -1475,7 +1475,8 @@ int32_t *jit_get_cover_ptr(jit_t *j, jit_value_t addr) void jit_interrupt(jit_t *j, jit_irq_fn_t fn, void *ctx) { relaxed_store(&j->interrupt_ctx, ctx); - store_release(&j->interrupt, fn); + if (!atomic_cas(&j->interrupt, NULL, fn)) + fatal_exit(1); } __attribute__((cold, noinline)) -- 2.39.2