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 <ex/pool.h>
#include <ob/cache.h> #include <ob/cache.h>
#include <string.h> #include <string.h>
#include <atomic.h>
ST_STATUS ST_STATUS
ObCreateDirectory(const CHAR *Name, ST_OBJECT **Result) ObCreateDirectory(const CHAR *Name, ST_OBJECT **Result)
@@ -93,9 +94,7 @@ ObReclaimObject(ST_OBJECT *Object)
return; return;
} }
/* TODO: Decrement this atomically */ if (AtomicDecLong(&Object->RefCount) == 0) {
Object->RefCount -= 1;
if (Object->RefCount == 0) {
ObReclaimToCache(&gObCache, Object); ObReclaimToCache(&gObCache, Object);
} }
} }