Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
concurrent_queue.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 #include <condition_variable>
19 #include <queue>
20 #include <type_traits>
21 
22 namespace tc {
23 namespace autotune {
24 
30 template <typename T>
32  public:
33  void enqueue(T t);
34  T dequeueWaitFor(std::chrono::steady_clock::duration);
35  bool empty() const;
36  size_t size() const;
37 
38  private:
39  mutable std::mutex mtx_;
40  std::condition_variable cv_;
41  std::queue<T> queue_;
42 };
43 
44 } // namespace autotune
45 } // namespace tc
46 
size_t size() const
Definition: concurrent_queue-inl.h:50
std::mutex mtx_
Definition: concurrent_queue.h:39
Definition: concurrent_queue.h:31
void enqueue(T t)
Definition: concurrent_queue-inl.h:22
bool empty() const
Definition: concurrent_queue-inl.h:44
T dequeueWaitFor(std::chrono::steady_clock::duration)
Definition: concurrent_queue-inl.h:31
std::condition_variable cv_
Definition: concurrent_queue.h:40
std::queue< T > queue_
Definition: concurrent_queue.h:41