From e74365fe38fa9da0e72ddcd7c9140a405e027a81 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 21 Oct 2023 09:43:28 -0500 Subject: [PATCH] Be a bit safer with reference counting. We might want to revisit some uses of refcounts in the ev module to be more efficient if we care about signal atomicity (where memory order isn't really important) or multithreading atomicity. --- src/core/capi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/capi.c b/src/core/capi.c index c58a2811..498ffa97 100644 --- a/src/core/capi.c +++ b/src/core/capi.c @@ -505,7 +505,7 @@ JanetAtomicInt janet_atomic_dec(JanetAtomicInt volatile *x) { #ifdef JANET_WINDOWS return InterlockedDecrement(x); #else - return __atomic_add_fetch(x, -1, __ATOMIC_RELAXED); + return __atomic_add_fetch(x, -1, __ATOMIC_ACQ_REL); #endif }