| 445 | |
| 446 | static __thread struct event_base *current_base; |
| 447 | static 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 | |
| 477 | static void init_base_priority(pthread_t *t, struct event_base **bb, const char *who, int priority) |
| 478 | { |
nothing calls this directly
no test coverage detected