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

Function ztest_rll_lock

freebsd/contrib/openzfs/cmd/ztest/ztest.c:1494–1510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1492}
1493
1494static void
1495ztest_rll_lock(rll_t *rll, rl_type_t type)
1496{
1497 mutex_enter(&rll->rll_lock);
1498
1499 if (type == RL_READER) {
1500 while (rll->rll_writer != NULL)
1501 (void) cv_wait(&rll->rll_cv, &rll->rll_lock);
1502 rll->rll_readers++;
1503 } else {
1504 while (rll->rll_writer != NULL || rll->rll_readers)
1505 (void) cv_wait(&rll->rll_cv, &rll->rll_lock);
1506 rll->rll_writer = curthread;
1507 }
1508
1509 mutex_exit(&rll->rll_lock);
1510}
1511
1512static void
1513ztest_rll_unlock(rll_t *rll)

Callers 2

ztest_object_lockFunction · 0.85
ztest_range_lockFunction · 0.85

Calls 3

mutex_enterFunction · 0.85
cv_waitFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected