diff options
| author | 2020-02-11 10:46:25 -0400 | |
|---|---|---|
| committer | 2020-02-11 10:46:25 -0400 | |
| commit | c5aefe42aaec7afa29d317709cacc8524f7add20 (patch) | |
| tree | 5f9341ac7eb10d85b52c5a70e217f80963dc9e99 /src/core/hle/kernel/thread.h | |
| parent | Merge pull request #3372 from ReinUsesLisp/fix-back-stencil (diff) | |
| download | yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.tar.gz yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.tar.xz yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.zip | |
Kernel: Change WaitObject to Synchronization object. In order to better reflect RE.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 3bcf9e137..895258095 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "core/arm/arm_interface.h" | 12 | #include "core/arm/arm_interface.h" |
| 13 | #include "core/hle/kernel/object.h" | 13 | #include "core/hle/kernel/object.h" |
| 14 | #include "core/hle/kernel/wait_object.h" | 14 | #include "core/hle/kernel/synchronization_object.h" |
| 15 | #include "core/hle/result.h" | 15 | #include "core/hle/result.h" |
| 16 | 16 | ||
| 17 | namespace Kernel { | 17 | namespace Kernel { |
| @@ -95,7 +95,7 @@ enum class ThreadSchedMasks : u32 { | |||
| 95 | ForcePauseMask = 0x0070, | 95 | ForcePauseMask = 0x0070, |
| 96 | }; | 96 | }; |
| 97 | 97 | ||
| 98 | class Thread final : public WaitObject { | 98 | class Thread final : public SynchronizationObject { |
| 99 | public: | 99 | public: |
| 100 | explicit Thread(KernelCore& kernel); | 100 | explicit Thread(KernelCore& kernel); |
| 101 | ~Thread() override; | 101 | ~Thread() override; |
| @@ -104,11 +104,11 @@ public: | |||
| 104 | 104 | ||
| 105 | using ThreadContext = Core::ARM_Interface::ThreadContext; | 105 | using ThreadContext = Core::ARM_Interface::ThreadContext; |
| 106 | 106 | ||
| 107 | using ThreadWaitObjects = std::vector<std::shared_ptr<WaitObject>>; | 107 | using ThreadSynchronizationObjects = std::vector<std::shared_ptr<SynchronizationObject>>; |
| 108 | 108 | ||
| 109 | using WakeupCallback = | 109 | using WakeupCallback = |
| 110 | std::function<bool(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, | 110 | std::function<bool(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, |
| 111 | std::shared_ptr<WaitObject> object, std::size_t index)>; | 111 | std::shared_ptr<SynchronizationObject> object, std::size_t index)>; |
| 112 | 112 | ||
| 113 | /** | 113 | /** |
| 114 | * Creates and returns a new thread. The new thread is immediately scheduled | 114 | * Creates and returns a new thread. The new thread is immediately scheduled |
| @@ -233,7 +233,7 @@ public: | |||
| 233 | * | 233 | * |
| 234 | * @param object Object to query the index of. | 234 | * @param object Object to query the index of. |
| 235 | */ | 235 | */ |
| 236 | s32 GetWaitObjectIndex(std::shared_ptr<WaitObject> object) const; | 236 | s32 GetSynchronizationObjectIndex(std::shared_ptr<SynchronizationObject> object) const; |
| 237 | 237 | ||
| 238 | /** | 238 | /** |
| 239 | * Stops a thread, invalidating it from further use | 239 | * Stops a thread, invalidating it from further use |
| @@ -314,15 +314,15 @@ public: | |||
| 314 | return owner_process; | 314 | return owner_process; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | const ThreadWaitObjects& GetWaitObjects() const { | 317 | const ThreadSynchronizationObjects& GetSynchronizationObjects() const { |
| 318 | return wait_objects; | 318 | return wait_objects; |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | void SetWaitObjects(ThreadWaitObjects objects) { | 321 | void SetSynchronizationObjects(ThreadSynchronizationObjects objects) { |
| 322 | wait_objects = std::move(objects); | 322 | wait_objects = std::move(objects); |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | void ClearWaitObjects() { | 325 | void ClearSynchronizationObjects() { |
| 326 | for (const auto& waiting_object : wait_objects) { | 326 | for (const auto& waiting_object : wait_objects) { |
| 327 | waiting_object->RemoveWaitingThread(SharedFrom(this)); | 327 | waiting_object->RemoveWaitingThread(SharedFrom(this)); |
| 328 | } | 328 | } |
| @@ -330,7 +330,7 @@ public: | |||
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | /// Determines whether all the objects this thread is waiting on are ready. | 332 | /// Determines whether all the objects this thread is waiting on are ready. |
| 333 | bool AllWaitObjectsReady() const; | 333 | bool AllSynchronizationObjectsReady() const; |
| 334 | 334 | ||
| 335 | const MutexWaitingThreads& GetMutexWaitingThreads() const { | 335 | const MutexWaitingThreads& GetMutexWaitingThreads() const { |
| 336 | return wait_mutex_threads; | 336 | return wait_mutex_threads; |
| @@ -395,7 +395,7 @@ public: | |||
| 395 | * will cause an assertion to trigger. | 395 | * will cause an assertion to trigger. |
| 396 | */ | 396 | */ |
| 397 | bool InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, | 397 | bool InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, |
| 398 | std::shared_ptr<WaitObject> object, std::size_t index); | 398 | std::shared_ptr<SynchronizationObject> object, std::size_t index); |
| 399 | 399 | ||
| 400 | u32 GetIdealCore() const { | 400 | u32 GetIdealCore() const { |
| 401 | return ideal_core; | 401 | return ideal_core; |
| @@ -494,7 +494,7 @@ private: | |||
| 494 | 494 | ||
| 495 | /// Objects that the thread is waiting on, in the same order as they were | 495 | /// Objects that the thread is waiting on, in the same order as they were |
| 496 | /// passed to WaitSynchronization. | 496 | /// passed to WaitSynchronization. |
| 497 | ThreadWaitObjects wait_objects; | 497 | ThreadSynchronizationObjects wait_objects; |
| 498 | 498 | ||
| 499 | /// List of threads that are waiting for a mutex that is held by this thread. | 499 | /// List of threads that are waiting for a mutex that is held by this thread. |
| 500 | MutexWaitingThreads wait_mutex_threads; | 500 | MutexWaitingThreads wait_mutex_threads; |