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

Function rm_init_flags

freebsd/kern/kern_rmlock.c:279–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void
280rm_init_flags(struct rmlock *rm, const char *name, int opts)
281{
282 struct lock_class *lc;
283 int liflags, xflags;
284
285 liflags = 0;
286 if (!(opts & RM_NOWITNESS))
287 liflags |= LO_WITNESS;
288 if (opts & RM_RECURSE)
289 liflags |= LO_RECURSABLE;
290 if (opts & RM_NEW)
291 liflags |= LO_NEW;
292 rm->rm_writecpus = all_cpus;
293 LIST_INIT(&rm->rm_activeReaders);
294 if (opts & RM_SLEEPABLE) {
295 liflags |= LO_SLEEPABLE;
296 lc = &lock_class_rm_sleepable;
297 xflags = (opts & RM_NEW ? SX_NEW : 0);
298 sx_init_flags(&rm->rm_lock_sx, "rmlock_sx",
299 xflags | SX_NOWITNESS);
300 } else {
301 lc = &lock_class_rm;
302 xflags = (opts & RM_NEW ? MTX_NEW : 0);
303 mtx_init(&rm->rm_lock_mtx, name, "rmlock_mtx",
304 xflags | MTX_NOWITNESS);
305 }
306 lock_init(&rm->lock_object, lc, name, NULL, liflags);
307}
308
309void
310rm_init(struct rmlock *rm, const char *name)

Callers 3

rm_initFunction · 0.70
rm_sysinitFunction · 0.70
mac_initFunction · 0.50

Calls 3

mtx_initFunction · 0.85
lock_initFunction · 0.85
sx_init_flagsFunction · 0.70

Tested by

no test coverage detected