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

Function __rw_rlock_int

freebsd/kern/kern_rwlock.c:660–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void
661__rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF)
662{
663 struct thread *td;
664 uintptr_t v;
665
666 td = curthread;
667
668 KASSERT(kdb_active != 0 || SCHEDULER_STOPPED_TD(td) ||
669 !TD_IS_IDLETHREAD(td),
670 ("rw_rlock() by idle thread %p on rwlock %s @ %s:%d",
671 td, rw->lock_object.lo_name, file, line));
672 KASSERT(rw->rw_lock != RW_DESTROYED,
673 ("rw_rlock() of destroyed rwlock @ %s:%d", file, line));
674 KASSERT(rw_wowner(rw) != td,
675 ("rw_rlock: wlock already held for %s @ %s:%d",
676 rw->lock_object.lo_name, file, line));
677 WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL);
678
679 v = RW_READ_VALUE(rw);
680 if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) ||
681 !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG)))
682 __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG);
683 else
684 lock_profile_obtain_lock_success(&rw->lock_object, 0, 0,
685 file, line);
686
687 LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line);
688 WITNESS_LOCK(&rw->lock_object, 0, file, line);
689 TD_LOCKS_INC(curthread);
690}
691
692void
693__rw_rlock(volatile uintptr_t *c, const char *file, int line)

Callers

nothing calls this directly

Calls 3

__rw_rlock_tryFunction · 0.85
__rw_rlock_hardFunction · 0.85

Tested by

no test coverage detected