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

Function __rw_runlock_try

freebsd/kern/kern_rwlock.c:744–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744static bool __always_inline
745__rw_runlock_try(struct rwlock *rw, struct thread *td, uintptr_t *vp)
746{
747
748 for (;;) {
749 if (RW_READERS(*vp) > 1 || !(*vp & RW_LOCK_WAITERS)) {
750 if (atomic_fcmpset_rel_ptr(&rw->rw_lock, vp,
751 *vp - RW_ONE_READER)) {
752 if (LOCK_LOG_TEST(&rw->lock_object, 0))
753 CTR4(KTR_LOCK,
754 "%s: %p succeeded %p -> %p",
755 __func__, rw, (void *)*vp,
756 (void *)(*vp - RW_ONE_READER));
757 td->td_rw_rlocks--;
758 return (true);
759 }
760 continue;
761 }
762 break;
763 }
764 return (false);
765}
766
767static void __noinline
768__rw_runlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v

Callers 2

__rw_runlock_hardFunction · 0.85
_rw_runlock_cookie_intFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected