From 898990c91a5ec176db6f00328a6039a03f2a5b09 Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Thu, 25 Jun 2026 19:10:27 +0000 Subject: [PATCH] stos: ob: Atomically decrement reference count Signed-off-by: Chloe M. --- paw/stos/ob/ob.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/paw/stos/ob/ob.c b/paw/stos/ob/ob.c index 07b6b67..dcd811f 100644 --- a/paw/stos/ob/ob.c +++ b/paw/stos/ob/ob.c @@ -10,6 +10,7 @@ #include #include #include +#include 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); } }