From 555cd26ec2b848634370a14d41b7e79b6c6beecd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 Mar 2019 00:29:54 -0400 Subject: core/hle/kernel: Make Mutex a per-process class. Makes it an instantiable class like it is in the actual kernel. This will also allow removing reliance on global accessors in a following change, now that we can encapsulate a reference to the system instance in the class. --- src/core/hle/kernel/process.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 47ffd4ad3..5e72300b6 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -14,6 +14,7 @@ #include "common/common_types.h" #include "core/hle/kernel/address_arbiter.h" #include "core/hle/kernel/handle_table.h" +#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/process_capability.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/kernel/wait_object.h" @@ -165,6 +166,16 @@ public: return address_arbiter; } + /// Gets a reference to the process' mutex lock. + Mutex& GetMutex() { + return mutex; + } + + /// Gets a const reference to the process' mutex lock + const Mutex& GetMutex() const { + return mutex; + } + /// Gets the current status of the process ProcessStatus GetStatus() const { return status; @@ -327,6 +338,11 @@ private: /// Per-process address arbiter. AddressArbiter address_arbiter; + /// The per-process mutex lock instance used for handling various + /// forms of services, such as lock arbitration, and condition + /// variable related facilities. + Mutex mutex; + /// Random values for svcGetInfo RandomEntropy std::array random_entropy; -- cgit v1.2.3