Add thread::fence (from $$fence builtin). Ref and RefCounted types.

This commit is contained in:
Christoffer Lerno
2025-07-22 00:37:41 +02:00
parent 869bcf8b2b
commit 53051e04a3
8 changed files with 168 additions and 0 deletions

View File

@@ -48,6 +48,11 @@ macro void? TimedMutex.lock_timeout(&mutex, ulong ms) => NativeTimedMutex.lock_t
macro bool TimedMutex.try_lock(&mutex) => NativeTimedMutex.try_lock((NativeTimedMutex*)mutex);
macro void? TimedMutex.unlock(&mutex) => NativeTimedMutex.unlock((NativeTimedMutex*)mutex);
macro void fence(AtomicOrdering $ordering) @safemacro
{
$$fence($ordering.ordinal);
}
macro void Mutex.@in_lock(&mutex; @body)
{
(void)mutex.lock();