diff options
Diffstat (limited to 'src/common/thread.h')
| -rw-r--r-- | src/common/thread.h | 10 |
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 | ||
| 61 | class Barrier { | 61 | class Barrier { |
| 62 | public: | 62 | public: |
| 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: | |||
| 80 | private: | 80 | private: |
| 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 | ||
| 88 | void SleepCurrentThread(int ms); | 88 | void SleepCurrentThread(int ms); |