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

Function rms_rlock

freebsd/kern/kern_rmlock.c:1020–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018}
1019
1020void
1021rms_rlock(struct rmslock *rms)
1022{
1023 struct rmslock_pcpu *pcpu;
1024
1025 WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
1026 MPASS(atomic_load_ptr(&rms->owner) != curthread);
1027
1028 critical_enter();
1029 pcpu = rms_int_pcpu(rms);
1030 rms_int_influx_enter(rms, pcpu);
1031 atomic_interrupt_fence();
1032 if (__predict_false(rms->writers > 0)) {
1033 rms_rlock_fallback(rms);
1034 return;
1035 }
1036 atomic_interrupt_fence();
1037 rms_int_readers_inc(rms, pcpu);
1038 atomic_interrupt_fence();
1039 rms_int_influx_exit(rms, pcpu);
1040 critical_exit();
1041}
1042
1043int
1044rms_try_rlock(struct rmslock *rms)

Callers 1

mac_policy_slock_sleepFunction · 0.85

Calls 7

rms_int_pcpuFunction · 0.85
rms_int_influx_enterFunction · 0.85
rms_rlock_fallbackFunction · 0.85
rms_int_readers_incFunction · 0.85
rms_int_influx_exitFunction · 0.85
critical_enterFunction · 0.50
critical_exitFunction · 0.50

Tested by

no test coverage detected