MCPcopy Create free account
hub / github.com/F-Stack/f-stack / refcount_acquiren

Function refcount_acquiren

freebsd/sys/refcount.h:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static __inline u_int
88refcount_acquiren(volatile u_int *count, u_int n)
89{
90 u_int old;
91
92 KASSERT(n < REFCOUNT_SATURATION_VALUE / 2,
93 ("refcount_acquiren: n=%u too large", n));
94 old = atomic_fetchadd_int(count, n);
95 if (__predict_false(REFCOUNT_SATURATED(old)))
96 _refcount_update_saturated(count);
97
98 return (old);
99}
100
101static __inline __result_use_check bool
102refcount_acquire_checked(volatile u_int *count)

Callers

nothing calls this directly

Calls 2

atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected