MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / net_dispatch

Function net_dispatch

net/net_evbuffer.c:447–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446static __thread struct event_base *current_base;
447static void *net_dispatch(void *arg)
448{
449 char thdname[32];
450 struct net_dispatch_info *n = arg;
451 snprintf(thdname, sizeof(thdname), "net_dispatch %s", n->who);
452 comdb2_name_thread(n->who);
453
454 current_base = n->base;
455 struct event *ev = event_new(n->base, -1, EV_PERSIST, nop, n);
456 struct timeval ten = {10, 0};
457
458 ENABLE_PER_THREAD_MALLOC(n->who);
459
460 event_add(ev, &ten);
461 if (start_callback) {
462 start_callback(start_stop_callback_data);
463 }
464 event_base_dispatch(n->base);
465 if (stop_callback) {
466 stop_callback(start_stop_callback_data);
467 }
468 event_del(ev);
469 event_free(ev);
470 free(n);
471 Pthread_mutex_lock(&exit_mtx);
472 Pthread_cond_signal(&exit_cond);
473 Pthread_mutex_unlock(&exit_mtx);
474 return NULL;
475}
476
477static void init_base_priority(pthread_t *t, struct event_base **bb, const char *who, int priority)
478{

Callers

nothing calls this directly

Calls 2

comdb2_name_threadFunction · 0.85
freeFunction · 0.85

Tested by

no test coverage detected