| 282 | } |
| 283 | |
| 284 | void |
| 285 | NetAccept::init_accept_per_thread() |
| 286 | { |
| 287 | int i, n; |
| 288 | int listen_per_thread = 0; |
| 289 | |
| 290 | REC_ReadConfigInteger(listen_per_thread, "proxy.config.exec_thread.listen"); |
| 291 | |
| 292 | if (listen_per_thread == 0) { |
| 293 | if (do_listen()) { |
| 294 | Fatal("[NetAccept::accept_per_thread]:error listenting on ports"); |
| 295 | return; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | SET_HANDLER(&NetAccept::accept_per_thread); |
| 300 | n = eventProcessor.thread_group[ET_NET]._count; |
| 301 | |
| 302 | for (i = 0; i < n; i++) { |
| 303 | NetAccept *a = (i < n - 1) ? clone() : this; |
| 304 | EThread *t = eventProcessor.thread_group[ET_NET]._thread[i]; |
| 305 | a->mutex = get_NetHandler(t)->mutex; |
| 306 | t->schedule_imm(a); |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | void |
| 311 | NetAccept::stop_accept() |
no test coverage detected