| 426 | } |
| 427 | |
| 428 | void DrainOnNetThread() { |
| 429 | if (!Ready()) return; |
| 430 | std::vector<std::vector<uint8_t>> batch; |
| 431 | { |
| 432 | std::lock_guard<std::mutex> lock(g_queueMutex); |
| 433 | while (!g_queue.empty()) { |
| 434 | batch.push_back(std::move(g_queue.front())); |
| 435 | g_queue.pop(); |
| 436 | } |
| 437 | } |
| 438 | for (auto& body : batch) |
| 439 | Apply(body); |
| 440 | } |
| 441 | |
| 442 | } // namespace LivePlaytime |