summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/synchronization.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/synchronization.h')
-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 @@
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
17namespace Kernel { 18namespace Kernel {
18 19
19class KernelCore;
20class SynchronizationObject; 20class 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 */
22class Synchronization { 27class Synchronization {
23public: 28public:
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