diff options
| author | 2019-03-14 00:29:54 -0400 | |
|---|---|---|
| committer | 2019-03-14 20:55:52 -0400 | |
| commit | 555cd26ec2b848634370a14d41b7e79b6c6beecd (patch) | |
| tree | 4ec6b8245280f94b44969356c9f2a44b22abd00e /src/core/hle/kernel/process.h | |
| parent | Merge pull request #2230 from lioncash/global (diff) | |
| download | yuzu-555cd26ec2b848634370a14d41b7e79b6c6beecd.tar.gz yuzu-555cd26ec2b848634370a14d41b7e79b6c6beecd.tar.xz yuzu-555cd26ec2b848634370a14d41b7e79b6c6beecd.zip | |
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.
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ | |||
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "core/hle/kernel/address_arbiter.h" | 15 | #include "core/hle/kernel/address_arbiter.h" |
| 16 | #include "core/hle/kernel/handle_table.h" | 16 | #include "core/hle/kernel/handle_table.h" |
| 17 | #include "core/hle/kernel/mutex.h" | ||
| 17 | #include "core/hle/kernel/process_capability.h" | 18 | #include "core/hle/kernel/process_capability.h" |
| 18 | #include "core/hle/kernel/vm_manager.h" | 19 | #include "core/hle/kernel/vm_manager.h" |
| 19 | #include "core/hle/kernel/wait_object.h" | 20 | #include "core/hle/kernel/wait_object.h" |
| @@ -165,6 +166,16 @@ public: | |||
| 165 | return address_arbiter; | 166 | return address_arbiter; |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 169 | /// Gets a reference to the process' mutex lock. | ||
| 170 | Mutex& GetMutex() { | ||
| 171 | return mutex; | ||
| 172 | } | ||
| 173 | |||
| 174 | /// Gets a const reference to the process' mutex lock | ||
| 175 | const Mutex& GetMutex() const { | ||
| 176 | return mutex; | ||
| 177 | } | ||
| 178 | |||
| 168 | /// Gets the current status of the process | 179 | /// Gets the current status of the process |
| 169 | ProcessStatus GetStatus() const { | 180 | ProcessStatus GetStatus() const { |
| 170 | return status; | 181 | return status; |
| @@ -327,6 +338,11 @@ private: | |||
| 327 | /// Per-process address arbiter. | 338 | /// Per-process address arbiter. |
| 328 | AddressArbiter address_arbiter; | 339 | AddressArbiter address_arbiter; |
| 329 | 340 | ||
| 341 | /// The per-process mutex lock instance used for handling various | ||
| 342 | /// forms of services, such as lock arbitration, and condition | ||
| 343 | /// variable related facilities. | ||
| 344 | Mutex mutex; | ||
| 345 | |||
| 330 | /// Random values for svcGetInfo RandomEntropy | 346 | /// Random values for svcGetInfo RandomEntropy |
| 331 | std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; | 347 | std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; |
| 332 | 348 | ||