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

Function _rw_init_flags

freebsd/kern/kern_rwlock.c:210–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208#endif
209
210void
211_rw_init_flags(volatile uintptr_t *c, const char *name, int opts)
212{
213 struct rwlock *rw;
214 int flags;
215
216 rw = rwlock2rw(c);
217
218 MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET |
219 RW_RECURSE | RW_NEW)) == 0);
220 ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock,
221 ("%s: rw_lock not aligned for %s: %p", __func__, name,
222 &rw->rw_lock));
223
224 flags = LO_UPGRADABLE;
225 if (opts & RW_DUPOK)
226 flags |= LO_DUPOK;
227 if (opts & RW_NOPROFILE)
228 flags |= LO_NOPROFILE;
229 if (!(opts & RW_NOWITNESS))
230 flags |= LO_WITNESS;
231 if (opts & RW_RECURSE)
232 flags |= LO_RECURSABLE;
233 if (opts & RW_QUIET)
234 flags |= LO_QUIET;
235 if (opts & RW_NEW)
236 flags |= LO_NEW;
237
238 lock_init(&rw->lock_object, &lock_class_rw, name, NULL, flags);
239 rw->rw_lock = RW_UNLOCKED;
240 rw->rw_recurse = 0;
241}
242
243void
244_rw_destroy(volatile uintptr_t *c)

Callers

nothing calls this directly

Calls 1

lock_initFunction · 0.85

Tested by

no test coverage detected