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

Function _sx_sunlock_try

freebsd/kern/kern_sx.c:1292–1313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1290}
1291
1292static bool __always_inline
1293_sx_sunlock_try(struct sx *sx, struct thread *td, uintptr_t *xp)
1294{
1295
1296 for (;;) {
1297 if (SX_SHARERS(*xp) > 1 || !(*xp & SX_LOCK_WAITERS)) {
1298 if (atomic_fcmpset_rel_ptr(&sx->sx_lock, xp,
1299 *xp - SX_ONE_SHARER)) {
1300 if (LOCK_LOG_TEST(&sx->lock_object, 0))
1301 CTR4(KTR_LOCK,
1302 "%s: %p succeeded %p -> %p",
1303 __func__, sx, (void *)*xp,
1304 (void *)(*xp - SX_ONE_SHARER));
1305 td->td_sx_slocks--;
1306 return (true);
1307 }
1308 continue;
1309 }
1310 break;
1311 }
1312 return (false);
1313}
1314
1315static void __noinline
1316_sx_sunlock_hard(struct sx *sx, struct thread *td, uintptr_t x

Callers 2

_sx_sunlock_hardFunction · 0.85
_sx_sunlock_intFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected