diff options
| author | 2020-06-28 01:34:07 +1000 | |
|---|---|---|
| committer | 2020-06-28 01:34:07 +1000 | |
| commit | 0ea4a8bcc4bca14bb7c65b248ed1899d2e7167cf (patch) | |
| tree | a83acb1e779b98d31fa54389bae4be5669573a41 /src/common/thread.h | |
| parent | Merge pull request #4097 from kevinxucs/kevinxucs/device-pixel-scaling-float (diff) | |
| parent | Common: Fix non-conan build (diff) | |
| download | yuzu-0ea4a8bcc4bca14bb7c65b248ed1899d2e7167cf.tar.gz yuzu-0ea4a8bcc4bca14bb7c65b248ed1899d2e7167cf.tar.xz yuzu-0ea4a8bcc4bca14bb7c65b248ed1899d2e7167cf.zip | |
Merge pull request #3396 from FernandoS27/prometheus-1
Implement SpinLocks, Fibers and a Host Timer
Diffstat (limited to 'src/common/thread.h')
| -rw-r--r-- | src/common/thread.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/thread.h b/src/common/thread.h index 2fc071685..127cc7e23 100644 --- a/src/common/thread.h +++ b/src/common/thread.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <cstddef> | 9 | #include <cstddef> |
| 10 | #include <mutex> | 10 | #include <mutex> |
| 11 | #include <thread> | 11 | #include <thread> |
| 12 | #include "common/common_types.h" | ||
| 12 | 13 | ||
| 13 | namespace Common { | 14 | namespace Common { |
| 14 | 15 | ||
| @@ -28,8 +29,7 @@ public: | |||
| 28 | is_set = false; | 29 | is_set = false; |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | template <class Duration> | 32 | bool WaitFor(const std::chrono::nanoseconds& time) { |
| 32 | bool WaitFor(const std::chrono::duration<Duration>& time) { | ||
| 33 | std::unique_lock lk{mutex}; | 33 | std::unique_lock lk{mutex}; |
| 34 | if (!condvar.wait_for(lk, time, [this] { return is_set; })) | 34 | if (!condvar.wait_for(lk, time, [this] { return is_set; })) |
| 35 | return false; | 35 | return false; |