summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/thread.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/thread.h b/src/common/thread.h
index 816183bc8..741dce487 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -15,8 +15,6 @@ namespace Common {
15 15
16class Event { 16class Event {
17public: 17public:
18 Event() : is_set(false) {}
19
20 void Set() { 18 void Set() {
21 std::lock_guard<std::mutex> lk(mutex); 19 std::lock_guard<std::mutex> lk(mutex);
22 if (!is_set) { 20 if (!is_set) {
@@ -48,14 +46,14 @@ public:
48 } 46 }
49 47
50private: 48private:
51 bool is_set; 49 bool is_set = false;
52 std::condition_variable condvar; 50 std::condition_variable condvar;
53 std::mutex mutex; 51 std::mutex mutex;
54}; 52};
55 53
56class Barrier { 54class Barrier {
57public: 55public:
58 explicit Barrier(std::size_t count_) : count(count_), waiting(0), generation(0) {} 56 explicit Barrier(std::size_t count_) : count(count_) {}
59 57
60 /// Blocks until all "count" threads have called Sync() 58 /// Blocks until all "count" threads have called Sync()
61 void Sync() { 59 void Sync() {
@@ -76,8 +74,8 @@ private:
76 std::condition_variable condvar; 74 std::condition_variable condvar;
77 std::mutex mutex; 75 std::mutex mutex;
78 const std::size_t count; 76 const std::size_t count;
79 std::size_t waiting; 77 std::size_t waiting = 0;
80 std::size_t generation; // Incremented once each time the barrier is used 78 std::size_t generation = 0; // Incremented once each time the barrier is used
81}; 79};
82 80
83void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask); 81void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask);