summary refs log tree commit diff
path: root/src/Compute
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compute')
-rw-r--r--src/Compute/Queue.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Compute/Queue.hpp b/src/Compute/Queue.hpp
index 77aed7f..4035d56 100644
--- a/src/Compute/Queue.hpp
+++ b/src/Compute/Queue.hpp
@@ -1,7 +1,7 @@
 #pragma once
 
+#include "../Common/Sizes.hpp"
 #include <functional>
-#include <sys/types.h>
 #include <mutex>
 #include <vector>
 #include <queue>
@@ -9,17 +9,17 @@
 
 namespace MC::Compute {
 
-template <typename X, typename I = uint>
+template <typename X, typename I = UInt>
 class Queue {
 public:
-    explicit Queue(uint workers) : m_control(std::make_shared<Control>()) {
-        for (uint w = 0; w < workers; w++) {
+    explicit Queue(UInt workers) : m_control(std::make_shared<Control>()) {
+        for (UInt w = 0; w < workers; w++) {
             std::thread thread{[=]{ Queue::run_thread(m_control); }};
             thread.detach();
         }
     }
 
-    void add(I id, float priority, std::function<X()> execute) {
+    void add(I id, Real priority, std::function<X()> execute) {
         std::scoped_lock work_lock(m_control->work.mutex);
         m_control->work.jobs.emplace(id, priority, execute);
     }
@@ -43,13 +43,13 @@ public:
 private:
     struct Job {
         Job() = default;
-        Job(I id, float priority, std::function<X()> execute) : id(id), priority(priority), execute(execute) {}
+        Job(I id, Real priority, std::function<X()> execute) : id(id), priority(priority), execute(execute) {}
 
         I id;
-        float priority;
+        Real priority;
         std::function<X()> execute;
 
-        bool operator>(const Job& other) const { return priority > other.priority; }
+        Bool operator>(const Job& other) const { return priority > other.priority; }
     };
 
     struct Work {
@@ -71,7 +71,7 @@ private:
         using namespace std::chrono_literals;
 
         while (true) {
-            bool nothing_to_do = true;
+            Bool nothing_to_do = true;
             Job job;
             {
                 std::scoped_lock work_lock(control->work.mutex);