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

Function rms_try_rlock

freebsd/kern/kern_rmlock.c:1043–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041}
1042
1043int
1044rms_try_rlock(struct rmslock *rms)
1045{
1046 struct rmslock_pcpu *pcpu;
1047
1048 MPASS(atomic_load_ptr(&rms->owner) != curthread);
1049
1050 critical_enter();
1051 pcpu = rms_int_pcpu(rms);
1052 rms_int_influx_enter(rms, pcpu);
1053 atomic_interrupt_fence();
1054 if (__predict_false(rms->writers > 0)) {
1055 rms_int_influx_exit(rms, pcpu);
1056 critical_exit();
1057 return (0);
1058 }
1059 atomic_interrupt_fence();
1060 rms_int_readers_inc(rms, pcpu);
1061 atomic_interrupt_fence();
1062 rms_int_influx_exit(rms, pcpu);
1063 critical_exit();
1064 return (1);
1065}
1066
1067static void __noinline
1068rms_runlock_fallback(struct rmslock *rms)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected