Lines Matching refs:eqp

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