| 2289 | } |
| 2290 | |
| 2291 | static void *thread_main(void *data) |
| 2292 | { |
| 2293 | struct conn *c = data; |
| 2294 | int ret; |
| 2295 | |
| 2296 | c->flags |= CONN_F_STARTED; |
| 2297 | |
| 2298 | /* we need a max of 4 descriptors for each client */ |
| 2299 | ret = init_ring(&c->ring, 4); |
| 2300 | if (ret) |
| 2301 | goto done; |
| 2302 | |
| 2303 | if (setup_buffer_rings(&c->ring, c)) |
| 2304 | goto done; |
| 2305 | |
| 2306 | /* |
| 2307 | * If we're using fixed files, then we need to wait for the parent |
| 2308 | * to install the c->in_fd into our direct descriptor table. When |
| 2309 | * that happens, we'll set things up. If we're not using fixed files, |
| 2310 | * we can set up the receive or connect now. |
| 2311 | */ |
| 2312 | if (!fixed_files) |
| 2313 | open_socket(c); |
| 2314 | |
| 2315 | /* we're ready */ |
| 2316 | pthread_barrier_wait(&c->startup_barrier); |
| 2317 | |
| 2318 | __event_loop(&c->ring, c); |
| 2319 | done: |
| 2320 | return NULL; |
| 2321 | } |
| 2322 | |
| 2323 | static void usage(const char *name) |
| 2324 | { |
nothing calls this directly
no test coverage detected