diff options
| author | 2020-02-13 17:01:44 -0400 | |
|---|---|---|
| committer | 2020-02-13 19:10:33 -0400 | |
| commit | 2bc949628dfa2efe9a18660b9d662e2a25cef9f9 (patch) | |
| tree | 84b72d7b0fcf8838c34c9ae0943dc297fa539e5b /src/core/hle/kernel/synchronization.h | |
| parent | Core: Set all hardware emulation constants in a single file. (diff) | |
| download | yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.gz yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.xz yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.zip | |
Core: Address Feedback
Diffstat (limited to 'src/core/hle/kernel/synchronization.h')
| -rw-r--r-- | src/core/hle/kernel/synchronization.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/hle/kernel/synchronization.h b/src/core/hle/kernel/synchronization.h index 3417a9f13..379f4b1d3 100644 --- a/src/core/hle/kernel/synchronization.h +++ b/src/core/hle/kernel/synchronization.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <utility> | 8 | #include <utility> |
| 9 | #include <vector> | ||
| 9 | 10 | ||
| 10 | #include "core/hle/kernel/object.h" | 11 | #include "core/hle/kernel/object.h" |
| 11 | #include "core/hle/result.h" | 12 | #include "core/hle/result.h" |
| @@ -16,15 +17,24 @@ class System; | |||
| 16 | 17 | ||
| 17 | namespace Kernel { | 18 | namespace Kernel { |
| 18 | 19 | ||
| 19 | class KernelCore; | ||
| 20 | class SynchronizationObject; | 20 | class SynchronizationObject; |
| 21 | 21 | ||
| 22 | /** | ||
| 23 | * The 'Synchronization' class is an interface for handling synchronization methods | ||
| 24 | * used by Synchronization objects and synchronization SVCs. This centralizes processing of | ||
| 25 | * such | ||
| 26 | */ | ||
| 22 | class Synchronization { | 27 | class Synchronization { |
| 23 | public: | 28 | public: |
| 24 | Synchronization(Core::System& system); | 29 | explicit Synchronization(Core::System& system); |
| 25 | 30 | ||
| 31 | /// Signals a synchronization object, waking up all its waiting threads | ||
| 26 | void SignalObject(SynchronizationObject& obj) const; | 32 | void SignalObject(SynchronizationObject& obj) const; |
| 27 | 33 | ||
| 34 | /// Tries to see if waiting for any of the sync_objects is necessary, if not | ||
| 35 | /// it returns Success and the handle index of the signaled sync object. In | ||
| 36 | /// case not, the current thread will be locked and wait for nano_seconds or | ||
| 37 | /// for a synchronization object to signal. | ||
| 28 | std::pair<ResultCode, Handle> WaitFor( | 38 | std::pair<ResultCode, Handle> WaitFor( |
| 29 | std::vector<std::shared_ptr<SynchronizationObject>>& sync_objects, s64 nano_seconds); | 39 | std::vector<std::shared_ptr<SynchronizationObject>>& sync_objects, s64 nano_seconds); |
| 30 | 40 | ||