19 #include <condition_variable> 23 #include "scanner/util/blockingconcurrentqueue.h" 30 class Queue :
public BlockingConcurrentQueue<T> {
32 Queue(
size_t size=8) : BlockingConcurrentQueue<T>(size) {}
36 while (BlockingConcurrentQueue<T>::try_dequeue(t)) {}
39 inline size_t size() {
40 return BlockingConcurrentQueue<T>::size_approx();
43 inline void push(T item) {
44 bool success = BlockingConcurrentQueue<T>::enqueue(item);
45 LOG_IF(FATAL, !success) <<
"Queue push failed";
48 inline void pop(T& item) {
49 BlockingConcurrentQueue<T>::wait_dequeue(item);
Definition: database.cpp:36