| 338 | } |
| 339 | |
| 340 | int |
| 341 | NetHandler::waitForActivity(ink_hrtime timeout) |
| 342 | { |
| 343 | EventIO *epd = nullptr; |
| 344 | #if TS_USE_LINUX_IO_URING |
| 345 | IOUringContext *ur = IOUringContext::local_context(); |
| 346 | #endif |
| 347 | |
| 348 | Metrics::Counter::increment(net_rsb.handler_run); |
| 349 | SCOPED_MUTEX_LOCK(lock, mutex, this->thread); |
| 350 | |
| 351 | process_enabled_list(); |
| 352 | |
| 353 | #if TS_USE_LINUX_IO_URING |
| 354 | ur->submit(); |
| 355 | #endif |
| 356 | |
| 357 | // Polling event by PollCont |
| 358 | PollCont *p = get_PollCont(this->thread); |
| 359 | ink_hrtime pre_poll = ink_get_hrtime(); |
| 360 | p->do_poll(timeout); |
| 361 | ink_hrtime post_poll = ink_get_hrtime(); |
| 362 | ink_hrtime poll_time = post_poll - pre_poll; |
| 363 | |
| 364 | // Get & Process polling result |
| 365 | PollDescriptor *pd = get_PollDescriptor(this->thread); |
| 366 | for (int x = 0; x < pd->result; x++) { |
| 367 | epd = static_cast<EventIO *> get_ev_data(pd, x); |
| 368 | int flags = get_ev_events(pd, x); |
| 369 | epd->process_event(flags); |
| 370 | ev_next_event(pd, x); |
| 371 | } |
| 372 | |
| 373 | pd->result = 0; |
| 374 | |
| 375 | process_ready_list(); |
| 376 | ink_hrtime post_process = ink_get_hrtime(); |
| 377 | ink_hrtime process_time = post_process - post_poll; |
| 378 | this->thread->metrics.current_slice.load(std::memory_order_acquire)->record_io_stats(poll_time, process_time); |
| 379 | |
| 380 | #if TS_USE_LINUX_IO_URING |
| 381 | ur->service(); |
| 382 | #endif |
| 383 | |
| 384 | return EVENT_CONT; |
| 385 | } |
| 386 | |
| 387 | void |
| 388 | NetHandler::signalActivity() |
no test coverage detected