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

Function sx_init_flags

lib/ff_lock.c:292–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290};
291
292void
293sx_init_flags(struct sx *sx, const char *description, int opts)
294{
295 int flags;
296
297 MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK |
298 SX_NOPROFILE | SX_NEW)) == 0);
299
300 flags = LO_SLEEPABLE | LO_UPGRADABLE;
301 if (opts & SX_DUPOK)
302 flags |= LO_DUPOK;
303 if (opts & SX_NOPROFILE)
304 flags |= LO_NOPROFILE;
305 if (!(opts & SX_NOWITNESS))
306 flags |= LO_WITNESS;
307 if (opts & SX_RECURSE)
308 flags |= LO_RECURSABLE;
309 if (opts & SX_QUIET)
310 flags |= LO_QUIET;
311 if (opts & SX_NEW)
312 flags |= LO_NEW;
313
314 lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags);
315 //sx->sx_lock = SX_LOCK_UNLOCKED;
316 //sx->sx_recurse = 0;
317}
318
319void
320sx_destroy(struct sx *sx)

Callers

nothing calls this directly

Calls 1

lock_initFunction · 0.85

Tested by

no test coverage detected