mirror of
https://github.com/janet-lang/janet
synced 2024-11-17 22:24:49 +00:00
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.
This commit is contained in:
parent
46b34833c2
commit
e74365fe38
@ -505,7 +505,7 @@ JanetAtomicInt janet_atomic_dec(JanetAtomicInt volatile *x) {
|
|||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
return InterlockedDecrement(x);
|
return InterlockedDecrement(x);
|
||||||
#else
|
#else
|
||||||
return __atomic_add_fetch(x, -1, __ATOMIC_RELAXED);
|
return __atomic_add_fetch(x, -1, __ATOMIC_ACQ_REL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user