summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/synchronization.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-13 22:01:44 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2020-02-14 00:10:33 +0100
commit2bc949628dfa2efe9a18660b9d662e2a25cef9f9 (patch)
tree84b72d7b0fcf8838c34c9ae0943dc297fa539e5b /src/core/hle/kernel/synchronization.h
parentCore: Set all hardware emulation constants in a single file. (diff)
downloadyuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.gz
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.bz2
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.lz
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.xz
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.tar.zst
yuzu-2bc949628dfa2efe9a18660b9d662e2a25cef9f9.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/synchronization.h14
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 @@
#include <memory>
#include <utility>
+#include <vector>
#include "core/hle/kernel/object.h"
#include "core/hle/result.h"
@@ -16,15 +17,24 @@ class System;
namespace Kernel {
-class KernelCore;
class SynchronizationObject;
+/**
+ * The 'Synchronization' class is an interface for handling synchronization methods
+ * used by Synchronization objects and synchronization SVCs. This centralizes processing of
+ * such
+ */
class Synchronization {
public:
- Synchronization(Core::System& system);
+ explicit Synchronization(Core::System& system);
+ /// Signals a synchronization object, waking up all its waiting threads
void SignalObject(SynchronizationObject& obj) const;
+ /// Tries to see if waiting for any of the sync_objects is necessary, if not
+ /// it returns Success and the handle index of the signaled sync object. In
+ /// case not, the current thread will be locked and wait for nano_seconds or
+ /// for a synchronization object to signal.
std::pair<ResultCode, Handle> WaitFor(
std::vector<std::shared_ptr<SynchronizationObject>>& sync_objects, s64 nano_seconds);