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

Function atomic_testandset_acq_long

freebsd/sys/_atomic_subword.h:221–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 */
220#ifndef atomic_testandset_acq_long
221static __inline int
222atomic_testandset_acq_long(volatile u_long *p, u_int v)
223{
224 u_long bit, old;
225 bool ret;
226
227 bit = (1ul << (v % (sizeof(*p) * NBBY)));
228
229 old = atomic_load_acq_long(p);
230 ret = false;
231 while (!ret && (old & bit) == 0)
232 ret = atomic_fcmpset_acq_long(p, &old, old | bit);
233
234 return (!ret);
235}
236#endif
237
238#ifndef atomic_testandset_long

Callers

nothing calls this directly

Calls 2

atomic_load_acq_longFunction · 0.85
atomic_fcmpset_acq_longFunction · 0.85

Tested by

no test coverage detected