| 164 | }; |
| 165 | |
| 166 | void |
| 167 | initialize_thread_for_net(EThread *thread) |
| 168 | { |
| 169 | NetHandler *nh = get_NetHandler(thread); |
| 170 | |
| 171 | new (reinterpret_cast<ink_dummy_for_new *>(nh)) NetHandler(); |
| 172 | new (reinterpret_cast<ink_dummy_for_new *>(get_PollCont(thread))) PollCont(thread->mutex, nh); |
| 173 | nh->mutex = new_ProxyMutex(); |
| 174 | nh->thread = thread; |
| 175 | |
| 176 | PollCont *pc = get_PollCont(thread); |
| 177 | PollDescriptor *pd = pc->pollDescriptor; |
| 178 | |
| 179 | InactivityCop *inactivityCop = new InactivityCop(get_NetHandler(thread)->mutex); |
| 180 | int cop_freq = 1; |
| 181 | |
| 182 | REC_ReadConfigInteger(cop_freq, "proxy.config.net.inactivity_check_frequency"); |
| 183 | memcpy(&nh->config, &NetHandler::global_config, sizeof(NetHandler::global_config)); |
| 184 | nh->configure_per_thread_values(); |
| 185 | thread->schedule_every(inactivityCop, HRTIME_SECONDS(cop_freq)); |
| 186 | |
| 187 | thread->set_tail_handler(nh); |
| 188 | |
| 189 | #if HAVE_EVENTFD |
| 190 | #if TS_USE_LINUX_IO_URING |
| 191 | auto ep = new IOUringEventIO(); |
| 192 | ep->start(pd, IOUringContext::local_context()); |
| 193 | #else |
| 194 | auto ep = new AsyncSignalEventIO(); |
| 195 | ep->start(pd, thread->evfd, EVENTIO_READ); |
| 196 | #endif |
| 197 | #else |
| 198 | auto ep = new AsyncSignalEventIO(); |
| 199 | ep->start(pd, thread->evpipe[0], EVENTIO_READ); |
| 200 | #endif |
| 201 | thread->ep = ep; |
| 202 | } |
nothing calls this directly
no test coverage detected