| 456 | } |
| 457 | |
| 458 | static void Loop(void* arg) |
| 459 | { |
| 460 | Worker* worker = (Worker*) arg; |
| 461 | |
| 462 | uint64_t flush_period = 5 * 1000000U; |
| 463 | uint64_t next_flush = dmTime::GetMonotonicTime() + flush_period; |
| 464 | while (worker->m_Run) |
| 465 | { |
| 466 | dmMessage::DispatchBlocking(worker->m_Socket, &Dispatch, worker); |
| 467 | if (!worker->m_Run) |
| 468 | break; |
| 469 | |
| 470 | if (worker->m_CacheFlusher && dmTime::GetMonotonicTime() > next_flush) { |
| 471 | dmHttpCache::Flush(worker->m_Service->m_HttpCache); |
| 472 | next_flush = dmTime::GetMonotonicTime() + flush_period; |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | static void LoadBalancer(void* arg) |
| 478 | { |
nothing calls this directly
no test coverage detected