summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/refcnt.h
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/hastd/refcnt.h')
-rw-r--r--sbin/hastd/refcnt.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/sbin/hastd/refcnt.h b/sbin/hastd/refcnt.h
index a989df0..1246043 100644
--- a/sbin/hastd/refcnt.h
+++ b/sbin/hastd/refcnt.h
@@ -36,15 +36,24 @@
#include "pjdlog.h"
+typedef unsigned int refcnt_t;
+
+static __inline void
+refcnt_init(refcnt_t *count, unsigned int v)
+{
+
+ *count = v;
+}
+
static __inline void
-refcnt_acquire(volatile unsigned int *count)
+refcnt_acquire(refcnt_t *count)
{
atomic_add_acq_int(count, 1);
}
static __inline unsigned int
-refcnt_release(volatile unsigned int *count)
+refcnt_release(refcnt_t *count)
{
unsigned int old;
OpenPOWER on IntegriCloud