Lines Matching refs:pollset

65     struct epoll_event *pollset;
80 static apr_status_t impl_pollset_cleanup(apr_pollset_t *pollset)
82 close(pollset->p->epoll_fd);
87 static apr_status_t impl_pollset_create(apr_pollset_t *pollset,
101 pollset->p = NULL;
112 pollset->p = NULL;
120 pollset->p = NULL;
126 pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t));
130 ((rv = apr_thread_mutex_create(&pollset->p->ring_lock,
134 pollset->p = NULL;
140 pollset->p = NULL;
144 pollset->p->epoll_fd = fd;
145 pollset->p->pollset = apr_palloc(p, size * sizeof(struct epoll_event));
146 pollset->p->result_set = apr_palloc(p, size * sizeof(apr_pollfd_t));
149 APR_RING_INIT(&pollset->p->query_ring, pfd_elem_t, link);
150 APR_RING_INIT(&pollset->p->free_ring, pfd_elem_t, link);
151 APR_RING_INIT(&pollset->p->dead_ring, pfd_elem_t, link);
156 static apr_status_t impl_pollset_add(apr_pollset_t *pollset,
166 if (pollset->flags & APR_POLLSET_NOCOPY) {
172 if (!APR_RING_EMPTY(&(pollset->p->free_ring), pfd_elem_t, link)) {
173 elem = APR_RING_FIRST(&(pollset->p->free_ring));
177 elem = (pfd_elem_t *) apr_palloc(pollset->pool, sizeof(pfd_elem_t));
184 ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_ADD,
188 ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_ADD,
196 if (!(pollset->flags & APR_POLLSET_NOCOPY)) {
198 APR_RING_INSERT_TAIL(&(pollset->p->free_ring), elem, pfd_elem_t, link);
201 APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link);
209 static apr_status_t impl_pollset_remove(apr_pollset_t *pollset,
220 ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL,
224 ret = epoll_ctl(pollset->p->epoll_fd, EPOLL_CTL_DEL,
231 if (!(pollset->flags & APR_POLLSET_NOCOPY)) {
234 for (ep = APR_RING_FIRST(&(pollset->p->query_ring));
235 ep != APR_RING_SENTINEL(&(pollset->p->query_ring),
241 APR_RING_INSERT_TAIL(&(pollset->p->dead_ring),
253 static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
267 ret = epoll_wait(pollset->p->epoll_fd, pollset->p->pollset, pollset->nalloc,
280 if (pollset->flags & APR_POLLSET_NOCOPY) {
281 fdptr = (apr_pollfd_t *)(pollset->p->pollset[i].data.ptr);
284 fdptr = &(((pfd_elem_t *) (pollset->p->pollset[i].data.ptr))->pfd);
289 if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
291 fdptr->desc.f == pollset->wakeup_pipe[0]) {
292 apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
296 pollset->p->result_set[j] = *fdptr;
297 pollset->p->result_set[j].rtnevents =
298 get_epoll_revent(pollset->p->pollset[i].events);
306 *descriptors = pollset->p->result_set;
311 if (!(pollset->flags & APR_POLLSET_NOCOPY)) {
315 APR_RING_CONCAT(&(pollset->p->free_ring), &(pollset->p->dead_ring), pfd_elem_t, link);
380 pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event));
448 ret = epoll_wait(pollcb->fd, pollcb->pollset.epoll, pollcb->nalloc,
458 apr_pollfd_t *pollfd = (apr_pollfd_t *)(pollcb->pollset.epoll[i].data.ptr);
467 pollfd->rtnevents = get_epoll_revent(pollcb->pollset.epoll[i].events);