stos: ob: Atomically decrement reference count

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-25 19:10:27 +00:00
parent dbdd95d079
commit 898990c91a
+2 -3
View File
@@ -10,6 +10,7 @@
#include <ex/pool.h>
#include <ob/cache.h>
#include <string.h>
#include <atomic.h>
ST_STATUS
ObCreateDirectory(const CHAR *Name, ST_OBJECT **Result)
@@ -93,9 +94,7 @@ ObReclaimObject(ST_OBJECT *Object)
return;
}
/* TODO: Decrement this atomically */
Object->RefCount -= 1;
if (Object->RefCount == 0) {
if (AtomicDecLong(&Object->RefCount) == 0) {
ObReclaimToCache(&gObCache, Object);
}
}