Lines Matching refs:eqp

419 evch_delivery_hold(evch_eventq_t *eqp, callb_cpr_t *cpip)
421 if (eqp->eq_tabortflag == 0) {
423 if (eqp->eq_holdmode) {
424 cv_signal(&eqp->eq_onholdcv);
427 cv_wait(&eqp->eq_thrsleepcv, &eqp->eq_queuemx);
428 CALLB_CPR_SAFE_END(cpip, &eqp->eq_queuemx);
429 } while (eqp->eq_holdmode);
438 evch_delivery_thr(evch_eventq_t *eqp)
449 (int)eqp->eq_thrid);
450 CALLB_CPR_INIT(&cprinfo, &eqp->eq_queuemx, callb_generic_cpr, thnam);
451 mutex_enter(&eqp->eq_queuemx);
452 while (eqp->eq_tabortflag == 0) {
453 while (eqp->eq_holdmode == 0 && eqp->eq_tabortflag == 0 &&
454 (qep = evch_q_out(&eqp->eq_eventq)) != NULL) {
459 eqp->eq_curevent = qep->q_objref;
460 sub = evch_dl_next(&eqp->eq_subscr, NULL);
462 eqp->eq_dactive = 1;
463 mutex_exit(&eqp->eq_queuemx);
465 mutex_enter(&eqp->eq_queuemx);
466 eqp->eq_dactive = 0;
467 cv_signal(&eqp->eq_dactivecv);
473 eqp->eq_holdmode = 1;
474 evch_delivery_hold(eqp, &cprinfo);
475 if (eqp->eq_tabortflag) {
481 mutex_exit(&eqp->eq_queuemx);
486 mutex_enter(&eqp->eq_queuemx);
488 &eqp->eq_queuemx);
494 if (eqp->eq_tabortflag) {
497 sub = evch_dl_next(&eqp->eq_subscr, sub);
500 eqp->eq_curevent = NULL;
508 evch_delivery_hold(eqp, &cprinfo);
510 CALLB_CPR_EXIT(&cprinfo); /* Does mutex_exit of eqp->eq_queuemx */
518 evch_evq_thrcreate(evch_eventq_t *eqp)
522 thp = thread_create(NULL, 0, evch_delivery_thr, (char *)eqp, 0, &p0,
524 eqp->eq_thrid = thp->t_did;
556 evch_evq_destroy(evch_eventq_t *eqp)
560 ASSERT(evch_dl_getnum(&eqp->eq_subscr) == 0);
562 if (eqp->eq_thrid != NULL) {
563 mutex_enter(&eqp->eq_queuemx);
564 eqp->eq_tabortflag = 1;
565 eqp->eq_holdmode = 0;
566 cv_signal(&eqp->eq_thrsleepcv);
567 mutex_exit(&eqp->eq_queuemx);
568 thread_join(eqp->eq_thrid);
572 while ((qep = (evch_qelem_t *)evch_q_out(&eqp->eq_eventq)) != NULL) {
578 cv_destroy(&eqp->eq_onholdcv);
579 cv_destroy(&eqp->eq_dactivecv);
580 cv_destroy(&eqp->eq_thrsleepcv);
581 evch_dl_fini(&eqp->eq_subscr);
582 mutex_destroy(&eqp->eq_queuemx);
585 kmem_free(eqp, sizeof (evch_eventq_t));
593 evch_evq_sub(evch_eventq_t *eqp, filter_f filter, void *fcookie,
605 mutex_enter(&eqp->eq_queuemx);
606 evch_dl_add(&eqp->eq_subscr, &sp->su_link);
607 mutex_exit(&eqp->eq_queuemx);
615 evch_evq_unsub(evch_eventq_t *eqp, evch_evqsub_t *sp)
617 mutex_enter(&eqp->eq_queuemx);
620 if (eqp->eq_dactive) {
621 cv_wait(&eqp->eq_dactivecv, &eqp->eq_queuemx);
623 evch_dl_del(&eqp->eq_subscr, &sp->su_link);
624 mutex_exit(&eqp->eq_queuemx);
632 evch_evq_pub(evch_eventq_t *eqp, void *ev, int flags)
651 mutex_enter(&eqp->eq_queuemx);
652 evch_q_in(&eqp->eq_eventq, qep);
655 cv_signal(&eqp->eq_thrsleepcv);
656 mutex_exit(&eqp->eq_queuemx);
665 evch_evq_stop(evch_eventq_t *eqp)
667 mutex_enter(&eqp->eq_queuemx);
668 eqp->eq_holdmode = 1;
670 cv_signal(&eqp->eq_thrsleepcv);
671 cv_wait(&eqp->eq_onholdcv, &eqp->eq_queuemx);
673 mutex_exit(&eqp->eq_queuemx);
680 evch_evq_continue(evch_eventq_t *eqp)
682 mutex_enter(&eqp->eq_queuemx);
683 eqp->eq_holdmode = 0;
684 cv_signal(&eqp->eq_thrsleepcv);
685 mutex_exit(&eqp->eq_queuemx);
692 evch_evq_status(evch_eventq_t *eqp)
694 return (eqp->eq_holdmode);
1205 evch_eventq_t *eqp = chp->ch_queue;
1302 sdp->sd_msub = evch_evq_sub(eqp, evch_class_filter, clb,
1318 evch_evq_continue(eqp);