Lines Matching refs:eqp

423 evch_delivery_hold(evch_eventq_t *eqp, callb_cpr_t *cpip)  in evch_delivery_hold()  argument
425 if (eqp->eq_tabortflag == 0) { in evch_delivery_hold()
427 if (eqp->eq_holdmode) { in evch_delivery_hold()
428 cv_signal(&eqp->eq_onholdcv); in evch_delivery_hold()
431 cv_wait(&eqp->eq_thrsleepcv, &eqp->eq_queuemx); in evch_delivery_hold()
432 CALLB_CPR_SAFE_END(cpip, &eqp->eq_queuemx); in evch_delivery_hold()
433 } while (eqp->eq_holdmode); in evch_delivery_hold()
442 evch_delivery_thr(evch_eventq_t *eqp) in evch_delivery_thr() argument
453 (int)eqp->eq_thrid); in evch_delivery_thr()
454 CALLB_CPR_INIT(&cprinfo, &eqp->eq_queuemx, callb_generic_cpr, thnam); in evch_delivery_thr()
455 mutex_enter(&eqp->eq_queuemx); in evch_delivery_thr()
456 while (eqp->eq_tabortflag == 0) { in evch_delivery_thr()
457 while (eqp->eq_holdmode == 0 && eqp->eq_tabortflag == 0 && in evch_delivery_thr()
458 (qep = evch_q_out(&eqp->eq_eventq)) != NULL) { in evch_delivery_thr()
463 eqp->eq_curevent = qep->q_objref; in evch_delivery_thr()
464 sub = evch_dl_next(&eqp->eq_subscr, NULL); in evch_delivery_thr()
466 eqp->eq_dactive = 1; in evch_delivery_thr()
467 mutex_exit(&eqp->eq_queuemx); in evch_delivery_thr()
469 mutex_enter(&eqp->eq_queuemx); in evch_delivery_thr()
470 eqp->eq_dactive = 0; in evch_delivery_thr()
471 cv_signal(&eqp->eq_dactivecv); in evch_delivery_thr()
477 eqp->eq_holdmode = 1; in evch_delivery_thr()
478 evch_delivery_hold(eqp, &cprinfo); in evch_delivery_thr()
479 if (eqp->eq_tabortflag) { in evch_delivery_thr()
485 mutex_exit(&eqp->eq_queuemx); in evch_delivery_thr()
490 mutex_enter(&eqp->eq_queuemx); in evch_delivery_thr()
492 &eqp->eq_queuemx); in evch_delivery_thr()
498 if (eqp->eq_tabortflag) { in evch_delivery_thr()
501 sub = evch_dl_next(&eqp->eq_subscr, sub); in evch_delivery_thr()
504 eqp->eq_curevent = NULL; in evch_delivery_thr()
512 evch_delivery_hold(eqp, &cprinfo); in evch_delivery_thr()
522 evch_evq_thrcreate(evch_eventq_t *eqp) in evch_evq_thrcreate() argument
526 thp = thread_create(NULL, 0, evch_delivery_thr, (char *)eqp, 0, &p0, in evch_evq_thrcreate()
528 eqp->eq_thrid = thp->t_did; in evch_evq_thrcreate()
560 evch_evq_destroy(evch_eventq_t *eqp) in evch_evq_destroy() argument
564 ASSERT(evch_dl_getnum(&eqp->eq_subscr) == 0); in evch_evq_destroy()
566 if (eqp->eq_thrid != 0) { in evch_evq_destroy()
567 mutex_enter(&eqp->eq_queuemx); in evch_evq_destroy()
568 eqp->eq_tabortflag = 1; in evch_evq_destroy()
569 eqp->eq_holdmode = 0; in evch_evq_destroy()
570 cv_signal(&eqp->eq_thrsleepcv); in evch_evq_destroy()
571 mutex_exit(&eqp->eq_queuemx); in evch_evq_destroy()
572 thread_join(eqp->eq_thrid); in evch_evq_destroy()
576 while ((qep = (evch_qelem_t *)evch_q_out(&eqp->eq_eventq)) != NULL) { in evch_evq_destroy()
582 cv_destroy(&eqp->eq_onholdcv); in evch_evq_destroy()
583 cv_destroy(&eqp->eq_dactivecv); in evch_evq_destroy()
584 cv_destroy(&eqp->eq_thrsleepcv); in evch_evq_destroy()
585 evch_dl_fini(&eqp->eq_subscr); in evch_evq_destroy()
586 mutex_destroy(&eqp->eq_queuemx); in evch_evq_destroy()
589 kmem_free(eqp, sizeof (evch_eventq_t)); in evch_evq_destroy()
597 evch_evq_sub(evch_eventq_t *eqp, filter_f filter, void *fcookie, in evch_evq_sub() argument
609 mutex_enter(&eqp->eq_queuemx); in evch_evq_sub()
610 evch_dl_add(&eqp->eq_subscr, &sp->su_link); in evch_evq_sub()
611 mutex_exit(&eqp->eq_queuemx); in evch_evq_sub()
619 evch_evq_unsub(evch_eventq_t *eqp, evch_evqsub_t *sp) in evch_evq_unsub() argument
621 mutex_enter(&eqp->eq_queuemx); in evch_evq_unsub()
624 if (eqp->eq_dactive) { in evch_evq_unsub()
625 cv_wait(&eqp->eq_dactivecv, &eqp->eq_queuemx); in evch_evq_unsub()
627 evch_dl_del(&eqp->eq_subscr, &sp->su_link); in evch_evq_unsub()
628 mutex_exit(&eqp->eq_queuemx); in evch_evq_unsub()
636 evch_evq_pub(evch_eventq_t *eqp, void *ev, int flags) in evch_evq_pub() argument
655 mutex_enter(&eqp->eq_queuemx); in evch_evq_pub()
656 evch_q_in(&eqp->eq_eventq, qep); in evch_evq_pub()
659 cv_signal(&eqp->eq_thrsleepcv); in evch_evq_pub()
660 mutex_exit(&eqp->eq_queuemx); in evch_evq_pub()
669 evch_evq_stop(evch_eventq_t *eqp) in evch_evq_stop() argument
671 mutex_enter(&eqp->eq_queuemx); in evch_evq_stop()
672 eqp->eq_holdmode = 1; in evch_evq_stop()
674 cv_signal(&eqp->eq_thrsleepcv); in evch_evq_stop()
675 cv_wait(&eqp->eq_onholdcv, &eqp->eq_queuemx); in evch_evq_stop()
677 mutex_exit(&eqp->eq_queuemx); in evch_evq_stop()
684 evch_evq_continue(evch_eventq_t *eqp) in evch_evq_continue() argument
686 mutex_enter(&eqp->eq_queuemx); in evch_evq_continue()
687 eqp->eq_holdmode = 0; in evch_evq_continue()
688 cv_signal(&eqp->eq_thrsleepcv); in evch_evq_continue()
689 mutex_exit(&eqp->eq_queuemx); in evch_evq_continue()
696 evch_evq_status(evch_eventq_t *eqp) in evch_evq_status() argument
698 return (eqp->eq_holdmode); in evch_evq_status()
1209 evch_eventq_t *eqp = chp->ch_queue; in evch_chsubscribe() local
1306 sdp->sd_msub = evch_evq_sub(eqp, evch_class_filter, clb, in evch_chsubscribe()
1322 evch_evq_continue(eqp); in evch_chsubscribe()