diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_synch.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 27e36501ae9..e877acff824 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.183 2022/03/10 15:21:08 bluhm Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.184 2022/03/16 14:13:01 visa Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -852,6 +852,18 @@ refcnt_finalize(struct refcnt *r, const char *wmesg) } } +int +refcnt_shared(struct refcnt *r) +{ + return (atomic_load_int(&r->r_refs) > 1); +} + +unsigned int +refcnt_read(struct refcnt *r) +{ + return (atomic_load_int(&r->r_refs)); +} + void cond_init(struct cond *c) { |