Lines Matching refs:ev

21     nxt_fd_event_t *ev);
23 nxt_fd_event_t *ev);
25 nxt_fd_event_t *ev);
27 nxt_fd_event_t *ev);
29 nxt_fd_event_t *ev);
31 nxt_fd_event_t *ev, nxt_uint_t events);
33 nxt_fd_event_t *ev);
35 nxt_fd_event_t *ev);
37 nxt_fd_event_t *ev);
42 nxt_fd_event_t *ev);
44 nxt_fd_event_t *ev);
46 nxt_fd_event_t *ev);
48 nxt_fd_event_t *ev);
50 nxt_fd_event_t *ev);
153 nxt_eventport_enable(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_enable() argument
155 ev->read = NXT_EVENT_ACTIVE; in nxt_eventport_enable()
156 ev->write = NXT_EVENT_ACTIVE; in nxt_eventport_enable()
158 nxt_eventport_enable_event(engine, ev, POLLIN | POLLOUT); in nxt_eventport_enable()
163 nxt_eventport_disable(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_disable() argument
165 if (ev->read != NXT_EVENT_INACTIVE || ev->write != NXT_EVENT_INACTIVE) { in nxt_eventport_disable()
167 ev->read = NXT_EVENT_INACTIVE; in nxt_eventport_disable()
168 ev->write = NXT_EVENT_INACTIVE; in nxt_eventport_disable()
170 nxt_eventport_disable_event(engine, ev); in nxt_eventport_disable()
182 nxt_eventport_close(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_close() argument
184 ev->read = NXT_EVENT_INACTIVE; in nxt_eventport_close()
185 ev->write = NXT_EVENT_INACTIVE; in nxt_eventport_close()
187 return ev->changing; in nxt_eventport_close()
192 nxt_eventport_enable_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_enable_read() argument
196 if (ev->read != NXT_EVENT_BLOCKED) { in nxt_eventport_enable_read()
197 events = (ev->write == NXT_EVENT_INACTIVE) ? POLLIN in nxt_eventport_enable_read()
199 nxt_eventport_enable_event(engine, ev, events); in nxt_eventport_enable_read()
202 ev->read = NXT_EVENT_ACTIVE; in nxt_eventport_enable_read()
207 nxt_eventport_enable_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_enable_write() argument
211 if (ev->write != NXT_EVENT_BLOCKED) { in nxt_eventport_enable_write()
212 events = (ev->read == NXT_EVENT_INACTIVE) ? POLLOUT in nxt_eventport_enable_write()
214 nxt_eventport_enable_event(engine, ev, events); in nxt_eventport_enable_write()
217 ev->write = NXT_EVENT_ACTIVE; in nxt_eventport_enable_write()
228 nxt_eventport_enable_event(nxt_event_engine_t *engine, nxt_fd_event_t *ev, in nxt_eventport_enable_event() argument
233 nxt_debug(ev->task, "port %d set event: fd:%d ev:%04XD u:%p", in nxt_eventport_enable_event()
234 engine->u.eventport.fd, ev->fd, events, ev); in nxt_eventport_enable_event()
240 ev->changing = 1; in nxt_eventport_enable_event()
244 change->event = ev; in nxt_eventport_enable_event()
249 nxt_eventport_disable_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_disable_read() argument
251 ev->read = NXT_EVENT_INACTIVE; in nxt_eventport_disable_read()
253 if (ev->write == NXT_EVENT_INACTIVE) { in nxt_eventport_disable_read()
254 nxt_eventport_disable_event(engine, ev); in nxt_eventport_disable_read()
257 nxt_eventport_enable_event(engine, ev, POLLOUT); in nxt_eventport_disable_read()
263 nxt_eventport_disable_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_disable_write() argument
265 ev->write = NXT_EVENT_INACTIVE; in nxt_eventport_disable_write()
267 if (ev->read == NXT_EVENT_INACTIVE) { in nxt_eventport_disable_write()
268 nxt_eventport_disable_event(engine, ev); in nxt_eventport_disable_write()
271 nxt_eventport_enable_event(engine, ev, POLLIN); in nxt_eventport_disable_write()
277 nxt_eventport_disable_event(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_disable_event() argument
281 nxt_debug(ev->task, "port %d disable event : fd:%d", in nxt_eventport_disable_event()
282 engine->u.eventport.fd, ev->fd); in nxt_eventport_disable_event()
288 ev->changing = 1; in nxt_eventport_disable_event()
292 change->event = ev; in nxt_eventport_disable_event()
301 nxt_fd_event_t *ev; in nxt_eventport_commit_changes() local
314 ev = change->event; in nxt_eventport_commit_changes()
315 ev->changing = 0; in nxt_eventport_commit_changes()
318 nxt_debug(ev->task, "port_associate(%d): fd:%d ev:%04XD u:%p", in nxt_eventport_commit_changes()
319 port, ev->fd, change->events, ev); in nxt_eventport_commit_changes()
322 ev->fd, change->events, ev); in nxt_eventport_commit_changes()
328 nxt_alert(ev->task, "port_associate(%d, %d, %d, %04XD) failed %E", in nxt_eventport_commit_changes()
329 port, PORT_SOURCE_FD, ev->fd, change->events, nxt_errno); in nxt_eventport_commit_changes()
332 nxt_debug(ev->task, "port_dissociate(%d): fd:%d", port, ev->fd); in nxt_eventport_commit_changes()
334 ret = port_dissociate(port, PORT_SOURCE_FD, ev->fd); in nxt_eventport_commit_changes()
340 nxt_alert(ev->task, "port_dissociate(%d, %d, %d) failed %E", in nxt_eventport_commit_changes()
341 port, PORT_SOURCE_FD, ev->fd, nxt_errno); in nxt_eventport_commit_changes()
346 ev->task, ev, ev->data); in nxt_eventport_commit_changes()
365 nxt_fd_event_t *ev; in nxt_eventport_error_handler() local
367 ev = obj; in nxt_eventport_error_handler()
369 ev->read = NXT_EVENT_INACTIVE; in nxt_eventport_error_handler()
370 ev->write = NXT_EVENT_INACTIVE; in nxt_eventport_error_handler()
372 ev->error_handler(task, ev, data); in nxt_eventport_error_handler()
377 nxt_eventport_block_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_block_read() argument
379 if (ev->read != NXT_EVENT_INACTIVE) { in nxt_eventport_block_read()
380 ev->read = NXT_EVENT_BLOCKED; in nxt_eventport_block_read()
386 nxt_eventport_block_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_block_write() argument
388 if (ev->write != NXT_EVENT_INACTIVE) { in nxt_eventport_block_write()
389 ev->write = NXT_EVENT_BLOCKED; in nxt_eventport_block_write()
395 nxt_eventport_oneshot_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_oneshot_read() argument
397 if (ev->read == NXT_EVENT_INACTIVE) { in nxt_eventport_oneshot_read()
398 ev->read = NXT_EVENT_ACTIVE; in nxt_eventport_oneshot_read()
400 nxt_eventport_enable_event(engine, ev, POLLIN); in nxt_eventport_oneshot_read()
406 nxt_eventport_oneshot_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_oneshot_write() argument
408 if (ev->write == NXT_EVENT_INACTIVE) { in nxt_eventport_oneshot_write()
409 ev->write = NXT_EVENT_ACTIVE; in nxt_eventport_oneshot_write()
411 nxt_eventport_enable_event(engine, ev, POLLOUT); in nxt_eventport_oneshot_write()
417 nxt_eventport_enable_accept(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_eventport_enable_accept() argument
419 ev->read = NXT_EVENT_LEVEL; in nxt_eventport_enable_accept()
421 nxt_eventport_enable_event(engine, ev, POLLIN); in nxt_eventport_enable_accept()
459 nxt_fd_event_t *ev; in nxt_eventport_poll() local
536 ev = event->portev_user; in nxt_eventport_poll()
539 nxt_debug(ev->task, "eventport: fd:%d ev:%04Xd u:%p rd:%d wr:%d", in nxt_eventport_poll()
540 event->portev_object, events, ev, ev->read, ev->write); in nxt_eventport_poll()
543 nxt_alert(ev->task, "port_getn(%d) error fd:%d events:%04Xud", in nxt_eventport_poll()
544 engine->u.eventport.fd, ev->fd, events); in nxt_eventport_poll()
548 ev->task, ev, ev->data); in nxt_eventport_poll()
553 ev->read_ready = 1; in nxt_eventport_poll()
555 if (ev->read != NXT_EVENT_BLOCKED) { in nxt_eventport_poll()
556 nxt_work_queue_add(ev->read_work_queue, ev->read_handler, in nxt_eventport_poll()
557 ev->task, ev, ev->data); in nxt_eventport_poll()
561 if (ev->read != NXT_EVENT_LEVEL) { in nxt_eventport_poll()
562 ev->read = NXT_EVENT_INACTIVE; in nxt_eventport_poll()
567 ev->write_ready = 1; in nxt_eventport_poll()
569 if (ev->write != NXT_EVENT_BLOCKED) { in nxt_eventport_poll()
570 nxt_work_queue_add(ev->write_work_queue, ev->write_handler, in nxt_eventport_poll()
571 ev->task, ev, ev->data); in nxt_eventport_poll()
574 ev->write = NXT_EVENT_INACTIVE; in nxt_eventport_poll()
581 events = (ev->read == NXT_EVENT_INACTIVE) ? 0 : POLLIN; in nxt_eventport_poll()
582 events |= (ev->write == NXT_EVENT_INACTIVE) ? 0 : POLLOUT; in nxt_eventport_poll()
585 nxt_eventport_enable_event(engine, ev, events); in nxt_eventport_poll()