mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
ConcurrentQueue: Add empty() function.
Change-Id: I563c0343f70a5e4577a6387914d821728cbdd007
This commit is contained in:
@@ -15,6 +15,11 @@
|
||||
template <typename T>
|
||||
class ConcurrentQueue {
|
||||
public:
|
||||
bool empty() const {
|
||||
std::unique_lock<std::mutex> mlock(mutex_);
|
||||
return queue_.empty();
|
||||
}
|
||||
|
||||
T pop() {
|
||||
std::unique_lock<std::mutex> mlock(mutex_);
|
||||
while (queue_.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user