summaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-09-17 09:51:47 -0400
committerGravatar GitHub2018-09-17 09:51:47 -0400
commit076add4ccddff3940e20fc320615e3d330f77119 (patch)
treebacabcfed8665974c276489509a1caa330ad36a2 /src/common/thread.h
parentMerge pull request #1329 from raven02/bgr5a1u (diff)
parentPort #4182 from Citra: "Prefix all size_t with std::" (diff)
downloadyuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.gz
yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.xz
yuzu-076add4ccddff3940e20fc320615e3d330f77119.zip
Merge pull request #1326 from FearlessTobi/port-4182
Port #4182 from Citra: "Prefix all size_t with std::"
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/thread.h b/src/common/thread.h
index 9465e1de7..12a1c095c 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -60,12 +60,12 @@ private:
60 60
61class Barrier { 61class Barrier {
62public: 62public:
63 explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {} 63 explicit Barrier(std::size_t count_) : count(count_), waiting(0), generation(0) {}
64 64
65 /// Blocks until all "count" threads have called Sync() 65 /// Blocks until all "count" threads have called Sync()
66 void Sync() { 66 void Sync() {
67 std::unique_lock<std::mutex> lk(mutex); 67 std::unique_lock<std::mutex> lk(mutex);
68 const size_t current_generation = generation; 68 const std::size_t current_generation = generation;
69 69
70 if (++waiting == count) { 70 if (++waiting == count) {
71 generation++; 71 generation++;
@@ -80,9 +80,9 @@ public:
80private: 80private:
81 std::condition_variable condvar; 81 std::condition_variable condvar;
82 std::mutex mutex; 82 std::mutex mutex;
83 const size_t count; 83 const std::size_t count;
84 size_t waiting; 84 std::size_t waiting;
85 size_t generation; // Incremented once each time the barrier is used 85 std::size_t generation; // Incremented once each time the barrier is used
86}; 86};
87 87
88void SleepCurrentThread(int ms); 88void SleepCurrentThread(int ms);