Lines Matching refs:portq
59 * We enter holding portq->portq_mutex but
64 port_block(port_queue_t *portq)
66 ASSERT(MUTEX_HELD(&portq->portq_mutex));
68 while (portq->portq_flags & PORTQ_BLOCKED)
69 cv_wait(&portq->portq_block_cv, &portq->portq_mutex);
70 portq->portq_flags |= PORTQ_BLOCKED;
74 * Undo port_block(portq).
77 port_unblock(port_queue_t *portq)
79 ASSERT(MUTEX_HELD(&portq->portq_mutex));
81 portq->portq_flags &= ~PORTQ_BLOCKED;
82 cv_signal(&portq->portq_block_cv);
97 port_queue_t *portq;
98 portq = &pp->port_queue;
99 mutex_enter(&portq->portq_mutex);
108 if (portq->portq_flags & PORTQ_POLLIN &&
109 !(portq->portq_flags & PORTQ_POLLWK_PEND)) {
110 portq->portq_flags &= ~PORTQ_POLLIN;
111 portq->portq_flags |= PORTQ_POLLWK_PEND;
114 mutex_exit(&portq->portq_mutex);
121 port_queue_t *portq;
122 portq = &pp->port_queue;
123 ASSERT(portq->portq_flags & PORTQ_POLLWK_PEND);
124 mutex_enter(&portq->portq_mutex);
125 portq->portq_flags &= ~PORTQ_POLLWK_PEND;
127 mutex_exit(&portq->portq_mutex);
146 port_queue_t *portq;
148 portq = &pkevp->portkev_port->port_queue;
149 mutex_enter(&portq->portq_mutex);
156 mutex_exit(&portq->portq_mutex);
161 list_insert_tail(&portq->portq_list, pkevp);
162 portq->portq_nent++;
168 portq->portq_flags &= ~PORTQ_WAIT_EVENTS;
176 if (portq->portq_flags & PORTQ_CLOSE) {
178 if (pkevp->portkev_port->port_curr <= portq->portq_nent)
179 cv_signal(&portq->portq_closecv);
182 if (portq->portq_getn == 0) {
187 if (portq->portq_thread &&
188 (portq->portq_nent >= portq->portq_nget))
189 cv_signal(&portq->portq_thread->portget_cv);
200 portq->portq_flags & PORTQ_POLLIN) {
203 portq->portq_flags &= ~PORTQ_POLLIN;
209 mutex_exit(&portq->portq_mutex);
212 mutex_exit(&portq->portq_mutex);
386 port_remove_event_doneq(port_kevent_t *pkevp, port_queue_t *portq)
388 ASSERT(MUTEX_HELD(&portq->portq_mutex));
389 list_remove(&portq->portq_list, pkevp);
390 portq->portq_nent--;
403 port_queue_t *portq;
406 portq = &pkevp->portkev_port->port_queue;
407 mutex_enter(&portq->portq_mutex);
409 port_block(portq);
412 if (portq->portq_getn) {
418 port_push_eventq(portq);
421 port_remove_event_doneq(pkevp, portq);
424 port_unblock(portq);
425 mutex_exit(&portq->portq_mutex);
438 port_queue_t *portq;
449 portq = &pp->port_queue;
450 mutex_enter(&portq->portq_mutex);
451 port_block(portq);
455 port_unblock(portq);
456 mutex_exit(&portq->portq_mutex);
459 port_unblock(portq);
462 mutex_exit(&portq->portq_mutex);
468 if (portq->portq_flags & PORTQ_CLOSE) {
476 if (pp->port_curr <= portq->portq_nent)
477 cv_signal(&portq->portq_closecv);
479 mutex_exit(&portq->portq_mutex);
492 port_queue_t *portq = &pp->port_queue;
501 mutex_enter(&portq->portq_mutex);
506 wakeup = (portq->portq_flags & PORTQ_POLLOUT);
507 portq->portq_flags &= ~PORTQ_POLLOUT;
508 mutex_exit(&portq->portq_mutex);
600 port_push_eventq(port_queue_t *portq)
606 list_move_tail(&portq->portq_list, &portq->portq_get_list);
607 portq->portq_nent += portq->portq_tnent;
608 portq->portq_tnent = 0;
619 port_queue_t *portq;
631 portq = &pp->port_queue;
632 mutex_enter(&portq->portq_mutex);
633 port_block(portq);
635 if (portq->portq_getn && portq->portq_tnent) {
640 port_push_eventq(portq);
643 port_remove_event_doneq(pkevp, portq);
646 port_unblock(portq);
647 mutex_exit(&portq->portq_mutex);