7#ifndef WPIUTIL_WPI_CONCURRENTQUEUE_H_
8#define WPIUTIL_WPI_CONCURRENTQUEUE_H_
23 std::unique_lock<wpi::mutex> mlock(mutex_);
24 return queue_.empty();
27 typename std::queue<T>::size_type
size()
const {
28 std::unique_lock<wpi::mutex> mlock(mutex_);
33 std::unique_lock<wpi::mutex> mlock(mutex_);
34 while (queue_.empty()) {
37 auto item = std::move(queue_.front());
43 std::unique_lock<wpi::mutex> mlock(mutex_);
44 while (queue_.empty()) {
47 item = queue_.front();
52 std::unique_lock<wpi::mutex> mlock(mutex_);
59 std::unique_lock<wpi::mutex> mlock(mutex_);
60 queue_.push(std::forward<T>(item));
65 template <
typename... Args>
67 std::unique_lock<wpi::mutex> mlock(mutex_);
68 queue_.emplace(std::forward<Args>(args)...);
Definition: ConcurrentQueue.h:20
void push(const T &item)
Definition: ConcurrentQueue.h:51
ConcurrentQueue(const ConcurrentQueue &)=delete
void pop(T &item)
Definition: ConcurrentQueue.h:42
std::queue< T >::size_type size() const
Definition: ConcurrentQueue.h:27
ConcurrentQueue & operator=(const ConcurrentQueue &)=delete
void push(T &&item)
Definition: ConcurrentQueue.h:58
void emplace(Args &&... args)
Definition: ConcurrentQueue.h:66
T pop()
Definition: ConcurrentQueue.h:32
ConcurrentQueue()=default
bool empty() const
Definition: ConcurrentQueue.h:22
/file This file defines the SmallVector class.
Definition: AprilTagFieldLayout.h:18
::std::mutex mutex
Definition: mutex.h:17
::std::condition_variable condition_variable
Definition: condition_variable.h:16