Address #1596 - Use atomic intrinsics to check allow_interrupt flag.

Use a relaxed memory order if possible to mitigate performance issues as
much as possible. relaxed memory order should be sufficient.
This commit is contained in:
Calvin Rose
2025-05-16 18:26:43 -05:00
parent 3d3e880f52
commit a8e2c8e5b8
4 changed files with 14 additions and 2 deletions
+1
View File
@@ -667,6 +667,7 @@ typedef int32_t JanetAtomicInt;
JANET_API JanetAtomicInt janet_atomic_inc(JanetAtomicInt volatile *x);
JANET_API JanetAtomicInt janet_atomic_dec(JanetAtomicInt volatile *x);
JANET_API JanetAtomicInt janet_atomic_load(JanetAtomicInt volatile *x);
JANET_API JanetAtomicInt janet_atomic_load_relaxed(JanetAtomicInt volatile *x);
/* We provide three possible implementations of Janets. The preferred
* nanboxing approach, for 32 or 64 bits, and the standard C version. Code in the rest of the