X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Feventclient%2Fserv_eventclient.c;h=a858048da260cddd16bbf6c90564ad51acaa1622;hp=a200754dc8a10f5821e8419bc30c5b425538a6b1;hb=c8e73a84d645c9806635b272df36ec85cb5bd427;hpb=e3534186f2a80bb2b5145c725ca4c9004927ce18 diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index a200754dc..a858048da 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -104,14 +104,11 @@ static void QueueEventAddCallback(struct ev_loop *loop, ev_io *watcher, int reve /// TODO: add it to QueueEvents break; case 'x': - /////event_del(&queue_add_event); close(event_add_pipe[0]); /// TODO; flush QueueEvents fd's and delete it. ev_io_stop(event_base, &queue_add_event); ev_unloop(event_base, EVUNLOOP_ALL); } - /* Unblock the other side */ -// read(fd, buf, 1); CtdlLogPrintf(CTDL_DEBUG, "EVENT Q Read done.\n"); } @@ -120,12 +117,6 @@ void InitEventQueue(void) { struct rlimit LimitSet; -/// event_base = ev_default_loop(0); -/* - base = event_base_new(); - if (!base) - return NULL; / *XXXerr*/ - citthread_mutex_init(&EventQueueMutex, NULL); if (pipe(event_add_pipe) != 0) { @@ -150,25 +141,11 @@ void *client_event_thread(void *arg) { struct CitContext libevent_client_CC; - CtdlFillSystemContext(&libevent_client_CC, "LibEvent Thread"); + CtdlFillSystemContext(&libevent_client_CC, "LibEv Thread"); // citthread_setspecific(MyConKey, (void *)&smtp_queue_CC); - CtdlLogPrintf(CTDL_DEBUG, "client_event_thread() initializing\n"); -/* - event_set(&queue_add_event, - event_add_pipe[0], - EV_READ|EV_PERSIST, - QueueEventAddCallback, - NULL); - - event_add(&queue_add_event, NULL); -*/ -/* - ev_io_init(&queue_add_event, QueueEventAddCallback, event_add_pipe[0], EV_READ); - ev_io_start(event_base, &queue_add_event); + CtdlLogPrintf(CTDL_DEBUG, "client_ev_thread() initializing\n"); -*/ event_base = ev_default_loop (EVFLAG_AUTO); -/// ev_loop(event_base, 0); ev_io_init(&queue_add_event, QueueEventAddCallback, event_add_pipe[0], EV_READ); ev_io_start(event_base, &queue_add_event);