| 22 | } |
| 23 | |
| 24 | void Queue::push_unique(std::uint64_t id, std::function<void()> function) |
| 25 | { |
| 26 | { |
| 27 | std::lock_guard lock(queueMutex); |
| 28 | if (queue.find(id) != queue.end()) |
| 29 | { |
| 30 | return; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | std::unique_lock lock(queueMutex); |
| 35 | queue.emplace(id, std::move(function)); |
| 36 | lock.unlock(); |
| 37 | |
| 38 | cv.notify_one(); |
| 39 | } |
| 40 | |
| 41 | Queue::Queue() |
| 42 | { |
no outgoing calls
no test coverage detected