summaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-07-04 00:59:40 -0400
committerAmeer <aj662@drexel.edu>2020-07-04 00:59:40 -0400
commitf829932ed191ad469df01342191bf2725e8a20bb (patch)
tree0ae185ce3ef43ef9b085aae7b9ad5abb04e3d239 /src/common/thread.h
parentd00972fce1fe5f2eb13c7e5d7e4e56036cb6bc91 (diff)
parent3096adb3471af1b094d670751e476c337007d299 (diff)
Fix merge conflicts?
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/thread.h b/src/common/thread.h
index 2fc071685..52b359413 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -9,6 +9,7 @@
#include <cstddef>
#include <mutex>
#include <thread>
+#include "common/common_types.h"
namespace Common {
@@ -28,8 +29,7 @@ public:
is_set = false;
}
- template <class Duration>
- bool WaitFor(const std::chrono::duration<Duration>& time) {
+ bool WaitFor(const std::chrono::nanoseconds& time) {
std::unique_lock lk{mutex};
if (!condvar.wait_for(lk, time, [this] { return is_set; }))
return false;
@@ -86,6 +86,15 @@ private:
std::size_t generation = 0; // Incremented once each time the barrier is used
};
+enum class ThreadPriority : u32 {
+ Low = 0,
+ Normal = 1,
+ High = 2,
+ VeryHigh = 3,
+};
+
+void SetCurrentThreadPriority(ThreadPriority new_priority);
+
void SetCurrentThreadName(const char* name);
} // namespace Common