Lines Matching defs:qp
193 queue_add(qu_t *qp, void *data)
196 (struct q_node *)qp->nalloc(sizeof (struct q_node));
201 dm_assert(pthread_mutex_lock(&qp->mutex) == 0);
203 if (qp->nodep == NULL)
204 qp->nodep = qnp;
206 nodep = qp->nodep;
215 if (qp->boe && qp->nodep == qnp)
216 dm_assert(pthread_cond_broadcast(&qp->cvar) == 0);
217 dm_assert(pthread_mutex_unlock(&qp->mutex) == 0);
221 queue_remove(qu_t *qp)
226 dm_assert(pthread_mutex_lock(&qp->mutex) == 0);
229 while (qp->boe && qp->nodep == NULL) {
230 (void) pthread_cond_wait(&qp->cvar, &qp->mutex);
236 if (qp->nodep != NULL) {
237 rv = qp->nodep->data;
238 nextnode = qp->nodep->next;
239 qp->nfree(qp->nodep, sizeof (struct q_node));
240 qp->nodep = nextnode;
243 dm_assert(pthread_mutex_unlock(&qp->mutex) == 0);
267 qu_t *qp = *qpp;
270 dm_assert(pthread_mutex_destroy(&qp->mutex) == 0);
271 dm_assert(pthread_cond_destroy(&qp->cvar) == 0);
273 qp->boe = B_FALSE;
275 while ((item = queue_remove(qp)) != NULL) {
276 qp->data_dealloc(item);
279 dm_assert(qp->nodep == NULL);
281 dfree(qp, sizeof (qu_t));