summaryrefslogtreecommitdiffstats
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-11-22 03:44:58 +0100
committerLioncash <mathew1800@gmail.com>2018-11-22 03:45:01 +0100
commit756e773096c5a64cb5c0ff48104ceb36fa1935cb (patch)
tree0f6cc34f9bf1213cfa8fd3faca64b8cd7d43b591 /src/common/thread.h
parentcommon/thread: Group non-member functions together (diff)
downloadyuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar.gz
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar.bz2
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar.lz
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar.xz
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.tar.zst
yuzu-756e773096c5a64cb5c0ff48104ceb36fa1935cb.zip
Diffstat (limited to '')
-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 {
class Event {
public:
- Event() : is_set(false) {}
-
void Set() {
std::lock_guard<std::mutex> lk(mutex);
if (!is_set) {
@@ -48,14 +46,14 @@ public:
}
private:
- bool is_set;
+ bool is_set = false;
std::condition_variable condvar;
std::mutex mutex;
};
class Barrier {
public:
- explicit Barrier(std::size_t count_) : count(count_), waiting(0), generation(0) {}
+ explicit Barrier(std::size_t count_) : count(count_) {}
/// Blocks until all "count" threads have called Sync()
void Sync() {
@@ -76,8 +74,8 @@ private:
std::condition_variable condvar;
std::mutex mutex;
const std::size_t count;
- std::size_t waiting;
- std::size_t generation; // Incremented once each time the barrier is used
+ std::size_t waiting = 0;
+ std::size_t generation = 0; // Incremented once each time the barrier is used
};
void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask);