20 std::scoped_lock lock(m_mutex, other.m_mutex);
21 m_queue = std::move(other.m_queue);
25 std::scoped_lock lock(m_mutex, other.m_mutex);
26 m_queue = std::move(other.m_queue);
32 std::lock_guard lock(m_mutex);
38 std::lock_guard lock(m_mutex);
39 m_queue.push(std::move(value));
44 std::lock_guard lock(m_mutex);
45 return m_queue.empty();
50 std::lock_guard lock(m_mutex);
51 return m_queue.size();
56 std::lock_guard lock(m_mutex);
58 throw std::out_of_range(
"Queue is empty");
59 auto value = m_queue.front();
64 std::queue<T> m_queue;
65 mutable TracyLockableN(std::mutex, m_mutex,
"Thread Safe Queue Mutex");
Definition: ThreadSafeQueue.hpp:10
ThreadSafeQueue()
Definition: ThreadSafeQueue.hpp:12
ThreadSafeQueue(const ThreadSafeQueue &other)=delete
T pop()
Definition: ThreadSafeQueue.hpp:54
bool empty() const
Definition: ThreadSafeQueue.hpp:42
void push(const T &value)
Definition: ThreadSafeQueue.hpp:30
ThreadSafeQueue & operator=(const ThreadSafeQueue &other)=delete
size_t size() const
Definition: ThreadSafeQueue.hpp:48
ThreadSafeQueue(ThreadSafeQueue &&other)
Definition: ThreadSafeQueue.hpp:18
~ThreadSafeQueue()
Definition: ThreadSafeQueue.hpp:13
ThreadSafeQueue & operator=(ThreadSafeQueue &&other)
Definition: ThreadSafeQueue.hpp:23
void push(T &&value)
Definition: ThreadSafeQueue.hpp:36