Lines Matching refs:me

400 static void setup_thread_notify(LIBEVENT_THREAD *me, struct thread_notify *tn,  in setup_thread_notify()  argument
404 EV_READ | EV_PERSIST, cb, me); in setup_thread_notify()
407 EV_READ | EV_PERSIST, cb, me); in setup_thread_notify()
409 event_base_set(me->base, &tn->notify_event); in setup_thread_notify()
420 static void setup_thread(LIBEVENT_THREAD *me) { in setup_thread() argument
425 me->base = event_base_new_with_config(ev_config); in setup_thread()
428 me->base = event_init(); in setup_thread()
431 if (! me->base) { in setup_thread()
437 setup_thread_notify(me, &me->n, thread_libevent_process); in setup_thread()
438 setup_thread_notify(me, &me->ion, thread_libevent_ionotify); in setup_thread()
439 pthread_mutex_init(&me->ion_lock, NULL); in setup_thread()
440 STAILQ_INIT(&me->ion_head); in setup_thread()
442 me->ev_queue = malloc(sizeof(struct conn_queue)); in setup_thread()
443 if (me->ev_queue == NULL) { in setup_thread()
447 cq_init(me->ev_queue); in setup_thread()
449 if (pthread_mutex_init(&me->stats.mutex, NULL) != 0) { in setup_thread()
454 me->rbuf_cache = cache_create("rbuf", READ_BUFFER_SIZE, sizeof(char *)); in setup_thread()
455 if (me->rbuf_cache == NULL) { in setup_thread()
468 cache_set_limit(me->rbuf_cache, limit); in setup_thread()
471 me->io_cache = cache_create("io", sizeof(io_pending_t), sizeof(char*)); in setup_thread()
472 if (me->io_cache == NULL) { in setup_thread()
478 me->ssl_wbuf = (char *)malloc((size_t)settings.ssl_wbuf_size); in setup_thread()
479 if (me->ssl_wbuf == NULL) { in setup_thread()
487 if (me->storage) { in setup_thread()
488 thread_io_queue_add(me, IO_QUEUE_EXTSTORE, me->storage, in setup_thread()
493 thread_io_queue_add(me, IO_QUEUE_PROXY, settings.proxy_ctx, proxy_submit_cb); in setup_thread()
498 proxy_thread_init(settings.proxy_ctx, me); in setup_thread()
501 thread_io_queue_add(me, IO_QUEUE_NONE, NULL, NULL); in setup_thread()
508 LIBEVENT_THREAD *me = arg; in worker_libevent() local
513 me->l = logger_create(); in worker_libevent()
514 me->lru_bump_buf = item_lru_bump_buf_create(); in worker_libevent()
515 if (me->l == NULL || me->lru_bump_buf == NULL) { in worker_libevent()
525 while (!event_base_got_exit(me->base)) { in worker_libevent()
526 event_base_loop(me->base, EVLOOP_ONCE); in worker_libevent()
527 if (me->proxy_ctx) { in worker_libevent()
528 proxy_gc_poke(me); in worker_libevent()
532 event_base_loop(me->base, 0); in worker_libevent()
537 event_base_free(me->base); in worker_libevent()
547 LIBEVENT_THREAD *me = arg; in thread_libevent_ionotify() local
572 pthread_mutex_lock(&me->ion_lock); in thread_libevent_ionotify()
573 STAILQ_CONCAT(&head, &me->ion_head); in thread_libevent_ionotify()
574 pthread_mutex_unlock(&me->ion_lock); in thread_libevent_ionotify()
588 LIBEVENT_THREAD *me = arg; in thread_libevent_process() local
613 item = cq_pop(me->ev_queue); in thread_libevent_process()
622 me->base, item->ssl, item->conntag, item->bproto); in thread_libevent_process()
639 c->thread = me; in thread_libevent_process()
663 event_base_loopexit(me->base, NULL); in thread_libevent_process()
667 proxy_worker_reload(settings.proxy_ctx, me); in thread_libevent_process()
672 cqi_free(me->ev_queue, item); in thread_libevent_process()