Lines Matching refs:rll
241 typedef struct rll {
1084 ztest_rll_init(rll_t *rll)
1086 rll->rll_writer = NULL;
1087 rll->rll_readers = 0;
1088 VERIFY(_mutex_init(&rll->rll_lock, USYNC_THREAD, NULL) == 0);
1089 VERIFY(cond_init(&rll->rll_cv, USYNC_THREAD, NULL) == 0);
1093 ztest_rll_destroy(rll_t *rll)
1095 ASSERT(rll->rll_writer == NULL);
1096 ASSERT(rll->rll_readers == 0);
1097 VERIFY(_mutex_destroy(&rll->rll_lock) == 0);
1098 VERIFY(cond_destroy(&rll->rll_cv) == 0);
1102 ztest_rll_lock(rll_t *rll, rl_type_t type)
1104 VERIFY(mutex_lock(&rll->rll_lock) == 0);
1107 while (rll->rll_writer != NULL)
1108 (void) cond_wait(&rll->rll_cv, &rll->rll_lock);
1109 rll->rll_readers++;
1111 while (rll->rll_writer != NULL || rll->rll_readers)
1112 (void) cond_wait(&rll->rll_cv, &rll->rll_lock);
1113 rll->rll_writer = curthread;
1116 VERIFY(mutex_unlock(&rll->rll_lock) == 0);
1120 ztest_rll_unlock(rll_t *rll)
1122 VERIFY(mutex_lock(&rll->rll_lock) == 0);
1124 if (rll->rll_writer) {
1125 ASSERT(rll->rll_readers == 0);
1126 rll->rll_writer = NULL;
1128 ASSERT(rll->rll_readers != 0);
1129 ASSERT(rll->rll_writer == NULL);
1130 rll->rll_readers--;
1133 if (rll->rll_writer == NULL && rll->rll_readers == 0)
1134 VERIFY(cond_broadcast(&rll->rll_cv) == 0);
1136 VERIFY(mutex_unlock(&rll->rll_lock) == 0);
1142 rll_t *rll = &zd->zd_object_lock[object & (ZTEST_OBJECT_LOCKS - 1)];
1144 ztest_rll_lock(rll, type);
1150 rll_t *rll = &zd->zd_object_lock[object & (ZTEST_OBJECT_LOCKS - 1)];
1152 ztest_rll_unlock(rll);
1160 rll_t *rll = &zd->zd_range_lock[hash & (ZTEST_RANGE_LOCKS - 1)];
1167 rl->rl_lock = rll;
1169 ztest_rll_lock(rll, type);
1177 rll_t *rll = rl->rl_lock;
1179 ztest_rll_unlock(rll);