36#include <condition_variable>
55 mutable std::mutex m_;
56 mutable std::condition_variable c_;
84 std::lock_guard<std::mutex> lock(m_);
85 q_.push(std::move(t));
96 std::unique_lock<std::mutex> lock(m_);
112 std::unique_lock<std::mutex> lock(m_);
A thread-safe queue implementation for storing and retrieving elements of type T.
Definition tec_queue.hpp:52
void enqueue(T &&t)
Adds an element to the back of the queue.
Definition tec_queue.hpp:83
~SafeQueue(void)=default
Destructor for the SafeQueue.
SafeQueue(void)
Constructs an empty thread-safe queue.
Definition tec_queue.hpp:64
T dequeue(void)
Retrieves and removes the front element from the queue.
Definition tec_queue.hpp:95
std::size_t size() const
Returns the current number of elements in the queue.
Definition tec_queue.hpp:111
Common definitions and utilities for the tec namespace.