diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-12-22 13:18:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 13:18:55 +0200 |
commit | 6f42311c4b32d42798f78de1fd43f53694f24e6e (patch) | |
tree | a48e85baea0d2feabdcddf1426a6a3c8c46c5568 /ml/Queue.h | |
parent | c1aec98b30d8a4e80813cfccd636c31999c7ae3e (diff) |
Revert "Refactor ML code and add support for multiple KMeans models. … (#14172)
Diffstat (limited to 'ml/Queue.h')
-rw-r--r-- | ml/Queue.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/ml/Queue.h b/ml/Queue.h deleted file mode 100644 index 2982355a86..0000000000 --- a/ml/Queue.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef QUEUE_H -#define QUEUE_H - -#include <queue> -#include <mutex> -#include <condition_variable> - -template<typename T> -class Queue { -public: - Queue(void) : Q(), Mutex(), CondVar() { } - - void push(T t) { - std::lock_guard<std::mutex> Lock(Mutex); - Q.push(t); - CondVar.notify_one(); - } - - std::pair<T, size_t> pop(void) { - std::unique_lock<std::mutex> Lock(Mutex); - while (Q.empty()) - CondVar.wait(Lock); - - T V = Q.front(); - size_t Size = Q.size(); - - Q.pop(); - return { V, Size }; - } - -private: - std::queue<T> Q; - std::mutex Mutex; - std::condition_variable CondVar; -}; - -#endif /* QUEUE_H */ |