Lines Matching refs:ev

28 static void nxt_pollset_enable(nxt_event_engine_t *engine, nxt_fd_event_t *ev);
29 static void nxt_pollset_disable(nxt_event_engine_t *engine, nxt_fd_event_t *ev);
31 nxt_fd_event_t *ev);
33 nxt_fd_event_t *ev);
35 nxt_fd_event_t *ev);
37 nxt_fd_event_t *ev);
39 nxt_fd_event_t *ev);
41 nxt_fd_event_t *ev);
43 nxt_fd_event_t *ev);
45 nxt_fd_event_t *ev);
47 nxt_fd_event_t *ev);
48 static void nxt_pollset_change(nxt_event_engine_t *engine, nxt_fd_event_t *ev,
52 nxt_fd_event_t *ev);
165 nxt_pollset_enable(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_enable() argument
167 ev->read = NXT_EVENT_ACTIVE; in nxt_pollset_enable()
168 ev->write = NXT_EVENT_ACTIVE; in nxt_pollset_enable()
170 nxt_pollset_change(engine, ev, NXT_POLLSET_ADD, POLLIN | POLLOUT); in nxt_pollset_enable()
175 nxt_pollset_disable(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_disable() argument
177 if (ev->read != NXT_EVENT_INACTIVE || ev->write != NXT_EVENT_INACTIVE) { in nxt_pollset_disable()
179 ev->read = NXT_EVENT_INACTIVE; in nxt_pollset_disable()
180 ev->write = NXT_EVENT_INACTIVE; in nxt_pollset_disable()
182 nxt_pollset_change(engine, ev, NXT_POLLSET_DELETE, 0); in nxt_pollset_disable()
203 nxt_pollset_close(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_close() argument
205 nxt_pollset_disable(engine, ev); in nxt_pollset_close()
207 return ev->changing; in nxt_pollset_close()
212 nxt_pollset_enable_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_enable_read() argument
216 if (ev->read != NXT_EVENT_BLOCKED) { in nxt_pollset_enable_read()
220 if (ev->write == NXT_EVENT_INACTIVE) { in nxt_pollset_enable_read()
223 } else if (ev->write == NXT_EVENT_BLOCKED) { in nxt_pollset_enable_read()
224 ev->write = NXT_EVENT_INACTIVE; in nxt_pollset_enable_read()
232 nxt_pollset_change(engine, ev, op, events); in nxt_pollset_enable_read()
235 ev->read = NXT_EVENT_ACTIVE; in nxt_pollset_enable_read()
240 nxt_pollset_enable_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_enable_write() argument
244 if (ev->write != NXT_EVENT_BLOCKED) { in nxt_pollset_enable_write()
248 if (ev->read == NXT_EVENT_INACTIVE) { in nxt_pollset_enable_write()
251 } else if (ev->read == NXT_EVENT_BLOCKED) { in nxt_pollset_enable_write()
252 ev->read = NXT_EVENT_INACTIVE; in nxt_pollset_enable_write()
260 nxt_pollset_change(engine, ev, op, events); in nxt_pollset_enable_write()
263 ev->write = NXT_EVENT_ACTIVE; in nxt_pollset_enable_write()
268 nxt_pollset_disable_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_disable_read() argument
272 ev->read = NXT_EVENT_INACTIVE; in nxt_pollset_disable_read()
274 if (ev->write <= NXT_EVENT_BLOCKED) { in nxt_pollset_disable_read()
275 ev->write = NXT_EVENT_INACTIVE; in nxt_pollset_disable_read()
284 nxt_pollset_change(engine, ev, op, events); in nxt_pollset_disable_read()
289 nxt_pollset_disable_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_disable_write() argument
293 ev->write = NXT_EVENT_INACTIVE; in nxt_pollset_disable_write()
295 if (ev->read <= NXT_EVENT_BLOCKED) { in nxt_pollset_disable_write()
296 ev->read = NXT_EVENT_INACTIVE; in nxt_pollset_disable_write()
305 nxt_pollset_change(engine, ev, op, events); in nxt_pollset_disable_write()
310 nxt_pollset_block_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_block_read() argument
312 if (ev->read != NXT_EVENT_INACTIVE) { in nxt_pollset_block_read()
313 ev->read = NXT_EVENT_BLOCKED; in nxt_pollset_block_read()
319 nxt_pollset_block_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_block_write() argument
321 if (ev->write != NXT_EVENT_INACTIVE) { in nxt_pollset_block_write()
322 ev->write = NXT_EVENT_BLOCKED; in nxt_pollset_block_write()
328 nxt_pollset_oneshot_read(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_oneshot_read() argument
330 nxt_pollset_enable_read(engine, ev); in nxt_pollset_oneshot_read()
332 ev->read = NXT_EVENT_ONESHOT; in nxt_pollset_oneshot_read()
337 nxt_pollset_oneshot_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_oneshot_write() argument
339 nxt_pollset_enable_write(engine, ev); in nxt_pollset_oneshot_write()
341 ev->write = NXT_EVENT_ONESHOT; in nxt_pollset_oneshot_write()
357 nxt_pollset_change(nxt_event_engine_t *engine, nxt_fd_event_t *ev, in nxt_pollset_change() argument
362 nxt_debug(ev->task, "pollset %d change fd:%d op:%ui ev:%04Xi", in nxt_pollset_change()
363 engine->u.pollset.ps, ev->fd, op, events); in nxt_pollset_change()
369 ev->changing = 1; in nxt_pollset_change()
375 change->event = ev; in nxt_pollset_change()
384 nxt_fd_event_t *ev; in nxt_pollset_commit_changes() local
398 ev = change->event; in nxt_pollset_commit_changes()
399 ev->changing = 0; in nxt_pollset_commit_changes()
402 ev->fd, change->op, change->events); in nxt_pollset_commit_changes()
408 ctl->fd = ev->fd; in nxt_pollset_commit_changes()
414 ctl->fd = ev->fd; in nxt_pollset_commit_changes()
438 ev = change->event; in nxt_pollset_commit_changes()
441 ret = nxt_fd_event_hash_add(&engine->u.pollset.fd_hash, ev->fd, ev); in nxt_pollset_commit_changes()
444 nxt_pollset_change_error(engine, ev); in nxt_pollset_commit_changes()
450 ev->fd, 0); in nxt_pollset_commit_changes()
466 nxt_pollset_change_error(nxt_event_engine_t *engine, nxt_fd_event_t *ev) in nxt_pollset_change_error() argument
468 ev->read = NXT_EVENT_INACTIVE; in nxt_pollset_change_error()
469 ev->write = NXT_EVENT_INACTIVE; in nxt_pollset_change_error()
471 nxt_work_queue_add(&engine->fast_work_queue, ev->error_handler, in nxt_pollset_change_error()
472 ev->task, ev, ev->data); in nxt_pollset_change_error()
475 ev->fd, 1); in nxt_pollset_change_error()
477 nxt_pollset_remove(engine, ev->fd); in nxt_pollset_change_error()
553 nxt_fd_event_t *ev; in nxt_pollset_poll() local
590 ev = nxt_fd_event_hash_get(&engine->task, &engine->u.pollset.fd_hash, in nxt_pollset_poll()
593 if (nxt_slow_path(ev == NULL)) { in nxt_pollset_poll()
603 nxt_debug(ev->task, "pollset: fd:%d ev:%04uXi", fd, events); in nxt_pollset_poll()
606 nxt_alert(ev->task, in nxt_pollset_poll()
610 nxt_work_queue_add(&engine->fast_work_queue, ev->error_handler, in nxt_pollset_poll()
611 ev->task, ev, ev->data); in nxt_pollset_poll()
616 ev->read_ready = 1; in nxt_pollset_poll()
618 if (ev->read != NXT_EVENT_BLOCKED) { in nxt_pollset_poll()
619 nxt_work_queue_add(ev->read_work_queue, ev->read_handler, in nxt_pollset_poll()
620 ev->task, ev, ev->data); in nxt_pollset_poll()
623 if (ev->read == NXT_EVENT_BLOCKED in nxt_pollset_poll()
624 || ev->read == NXT_EVENT_ONESHOT) in nxt_pollset_poll()
626 nxt_pollset_disable_read(engine, ev); in nxt_pollset_poll()
631 ev->write_ready = 1; in nxt_pollset_poll()
633 if (ev->write != NXT_EVENT_BLOCKED) { in nxt_pollset_poll()
634 nxt_work_queue_add(ev->write_work_queue, ev->write_handler, in nxt_pollset_poll()
635 ev->task, ev, ev->data); in nxt_pollset_poll()
638 if (ev->write == NXT_EVENT_BLOCKED in nxt_pollset_poll()
639 || ev->write == NXT_EVENT_ONESHOT) in nxt_pollset_poll()
641 nxt_pollset_disable_write(engine, ev); in nxt_pollset_poll()