Lines Matching refs:w
185 struct worker *w = (struct worker *) arg; in workerfn() local
186 unsigned long ops = w->ops; in workerfn()
190 int efd = multiq ? w->epollfd : epollfd; in workerfn()
233 close(w->epollfd); in workerfn()
235 w->ops = ops; in workerfn()
239 static void nest_epollfd(struct worker *w) in nest_epollfd() argument
243 int efd = multiq ? w->epollfd : epollfd; in nest_epollfd()
310 struct worker *w = &worker[i]; in do_threads() local
313 w->epollfd = epoll_create(1); in do_threads()
314 if (w->epollfd < 0) in do_threads()
318 nest_epollfd(w); in do_threads()
321 w->tid = i; in do_threads()
322 w->fdmap = calloc(nfds, sizeof(int)); in do_threads()
323 if (!w->fdmap) in do_threads()
327 int efd = multiq ? w->epollfd : epollfd; in do_threads()
330 w->fdmap[j] = eventfd(0, EFD_NONBLOCK); in do_threads()
331 if (w->fdmap[j] < 0) in do_threads()
334 ev.data.fd = w->fdmap[j]; in do_threads()
338 w->fdmap[j], &ev); in do_threads()
354 ret = pthread_create(&w->thread, attrp, workerfn, in do_threads()
355 (void *)(struct worker *) w); in do_threads()
384 struct worker *w = &worker[i]; in writerfn() local
387 shuffle((void *)w->fdmap, nfds, sizeof(int)); in writerfn()
392 sz = write(w->fdmap[j], &val, sizeof(val)); in writerfn()