MCPcopy Create free account
hub / github.com/Soundux/Soundux / handle

Method handle

src/helper/queue/queue.cpp:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace Soundux::Objects
4{
5 void Queue::handle()
6 {
7 std::unique_lock lock(queueMutex);
8 while (!stop)
9 {
10 cv.wait(lock, [&]() { return !queue.empty() || stop; });
11 while (!queue.empty())
12 {
13 auto front = std::move(*queue.begin());
14
15 lock.unlock();
16 front.second();
17 lock.lock();
18
19 queue.erase(front.first);
20 }
21 }
22 }
23
24 void Queue::push_unique(std::uint64_t id, std::function<void()> function)
25 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected