diff options
| author | 2015-01-20 17:41:12 -0500 | |
|---|---|---|
| committer | 2015-01-21 20:47:49 -0500 | |
| commit | c68eb1569549ae49ae25c6c29cec2e10d8329f2d (patch) | |
| tree | 4a8683aac99095884acaf488aa4d059f861138b3 /src/core/hle/kernel | |
| parent | Event: Fix implementation of "non-sticky" events. (diff) | |
| download | yuzu-c68eb1569549ae49ae25c6c29cec2e10d8329f2d.tar.gz yuzu-c68eb1569549ae49ae25c6c29cec2e10d8329f2d.tar.xz yuzu-c68eb1569549ae49ae25c6c29cec2e10d8329f2d.zip | |
WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual.
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/event.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/semaphore.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/session.h | 11 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 2 |
8 files changed, 20 insertions, 21 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 37f01652e..bed856020 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp | |||
| @@ -28,7 +28,7 @@ public: | |||
| 28 | bool signaled; ///< Whether the event has already been signaled | 28 | bool signaled; ///< Whether the event has already been signaled |
| 29 | std::string name; ///< Name of event (optional) | 29 | std::string name; ///< Name of event (optional) |
| 30 | 30 | ||
| 31 | ResultVal<bool> Wait() override { | 31 | ResultVal<bool> ShouldWait() override { |
| 32 | return MakeResult<bool>(!signaled); | 32 | return MakeResult<bool>(!signaled); |
| 33 | } | 33 | } |
| 34 | 34 | ||
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index ca9ccf4bf..1bb0b55bd 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -117,22 +117,16 @@ class WaitObject : public Object { | |||
| 117 | public: | 117 | public: |
| 118 | 118 | ||
| 119 | /** | 119 | /** |
| 120 | * Check if this object is available | 120 | * Check if the current thread should wait until the object is available |
| 121 | * @return True if the current thread should wait due to this object being unavailable | 121 | * @return True if the current thread should wait due to this object being unavailable |
| 122 | */ | 122 | */ |
| 123 | virtual ResultVal<bool> Wait() { | 123 | virtual ResultVal<bool> ShouldWait() = 0; |
| 124 | LOG_ERROR(Kernel, "(UNIMPLEMENTED)"); | ||
| 125 | return UnimplementedFunction(ErrorModule::Kernel); | ||
| 126 | } | ||
| 127 | 124 | ||
| 128 | /** | 125 | /** |
| 129 | * Acquire/lock the this object if it is available | 126 | * Acquire/lock the object if it is available |
| 130 | * @return True if we were able to acquire this object, otherwise false | 127 | * @return True if we were able to acquire this object, otherwise false |
| 131 | */ | 128 | */ |
| 132 | virtual ResultVal<bool> Acquire() { | 129 | virtual ResultVal<bool> Acquire() = 0; |
| 133 | LOG_ERROR(Kernel, "(UNIMPLEMENTED)"); | ||
| 134 | return UnimplementedFunction(ErrorModule::Kernel); | ||
| 135 | } | ||
| 136 | 130 | ||
| 137 | /** | 131 | /** |
| 138 | * Add a thread to wait on this object | 132 | * Add a thread to wait on this object |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 6cd140376..01d2263ff 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -27,7 +27,7 @@ public: | |||
| 27 | std::string name; ///< Name of mutex (optional) | 27 | std::string name; ///< Name of mutex (optional) |
| 28 | SharedPtr<Thread> current_thread; ///< Thread that has acquired the mutex | 28 | SharedPtr<Thread> current_thread; ///< Thread that has acquired the mutex |
| 29 | 29 | ||
| 30 | ResultVal<bool> Wait() override; | 30 | ResultVal<bool> ShouldWait() override; |
| 31 | ResultVal<bool> Acquire() override; | 31 | ResultVal<bool> Acquire() override; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| @@ -159,7 +159,7 @@ Handle CreateMutex(bool initial_locked, const std::string& name) { | |||
| 159 | return handle; | 159 | return handle; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | ResultVal<bool> Mutex::Wait() { | 162 | ResultVal<bool> Mutex::ShouldWait() { |
| 163 | return MakeResult<bool>(locked && (current_thread != GetCurrentThread())); | 163 | return MakeResult<bool>(locked && (current_thread != GetCurrentThread())); |
| 164 | } | 164 | } |
| 165 | 165 | ||
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 6ccdb2a8f..24d41c0b3 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp | |||
| @@ -32,7 +32,7 @@ public: | |||
| 32 | return available_count > 0; | 32 | return available_count > 0; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | ResultVal<bool> Wait() override { | 35 | ResultVal<bool> ShouldWait() override { |
| 36 | return MakeResult<bool>(!IsAvailable()); | 36 | return MakeResult<bool>(!IsAvailable()); |
| 37 | } | 37 | } |
| 38 | 38 | ||
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h index e11f727a5..f0343d9b2 100644 --- a/src/core/hle/kernel/session.h +++ b/src/core/hle/kernel/session.h | |||
| @@ -54,11 +54,16 @@ public: | |||
| 54 | */ | 54 | */ |
| 55 | virtual ResultVal<bool> SyncRequest() = 0; | 55 | virtual ResultVal<bool> SyncRequest() = 0; |
| 56 | 56 | ||
| 57 | ResultVal<bool> Wait() override { | 57 | // TODO(bunnei): These functions exist to satisfy a hardware test with a Session object |
| 58 | // TODO(bunnei): This function exists to satisfy a hardware test with a Session object | 58 | // passed into WaitSynchronization. Figure out the meaning of them. |
| 59 | // passed into WaitSynchronization. Not sure if it's possible for this to ever be false? | 59 | |
| 60 | ResultVal<bool> ShouldWait() override { | ||
| 60 | return MakeResult<bool>(true); | 61 | return MakeResult<bool>(true); |
| 61 | } | 62 | } |
| 63 | |||
| 64 | ResultVal<bool> Acquire() override { | ||
| 65 | return MakeResult<bool>(false); | ||
| 66 | } | ||
| 62 | }; | 67 | }; |
| 63 | 68 | ||
| 64 | } | 69 | } |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 271828ea7..8a2cf8bf4 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | namespace Kernel { | 23 | namespace Kernel { |
| 24 | 24 | ||
| 25 | ResultVal<bool> Thread::Wait() { | 25 | ResultVal<bool> Thread::ShouldWait() { |
| 26 | return MakeResult<bool>(status != THREADSTATUS_DORMANT); | 26 | return MakeResult<bool>(status != THREADSTATUS_DORMANT); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| @@ -269,7 +269,7 @@ void Thread::ReleaseWaitObject(WaitObject* wait_object) { | |||
| 269 | 269 | ||
| 270 | // Iterate through all waiting objects to check availability... | 270 | // Iterate through all waiting objects to check availability... |
| 271 | for (auto itr = wait_objects.begin(); itr != wait_objects.end(); ++itr) { | 271 | for (auto itr = wait_objects.begin(); itr != wait_objects.end(); ++itr) { |
| 272 | auto res = (*itr)->Wait(); | 272 | auto res = (*itr)->ShouldWait(); |
| 273 | 273 | ||
| 274 | if (*res && res.Succeeded()) | 274 | if (*res && res.Succeeded()) |
| 275 | wait_all_failed = true; | 275 | wait_all_failed = true; |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index a3a17e6c0..b23638bd1 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -58,7 +58,7 @@ public: | |||
| 58 | inline bool IsSuspended() const { return (status & THREADSTATUS_SUSPEND) != 0; } | 58 | inline bool IsSuspended() const { return (status & THREADSTATUS_SUSPEND) != 0; } |
| 59 | inline bool IsIdle() const { return idle; } | 59 | inline bool IsIdle() const { return idle; } |
| 60 | 60 | ||
| 61 | ResultVal<bool> Wait() override; | 61 | ResultVal<bool> ShouldWait() override; |
| 62 | ResultVal<bool> Acquire() override; | 62 | ResultVal<bool> Acquire() override; |
| 63 | 63 | ||
| 64 | s32 GetPriority() const { return current_priority; } | 64 | s32 GetPriority() const { return current_priority; } |
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 62bdf07c7..1729cca0f 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp | |||
| @@ -29,7 +29,7 @@ public: | |||
| 29 | u64 initial_delay; ///< The delay until the timer fires for the first time | 29 | u64 initial_delay; ///< The delay until the timer fires for the first time |
| 30 | u64 interval_delay; ///< The delay until the timer fires after the first time | 30 | u64 interval_delay; ///< The delay until the timer fires after the first time |
| 31 | 31 | ||
| 32 | ResultVal<bool> Wait() override { | 32 | ResultVal<bool> ShouldWait() override { |
| 33 | return MakeResult<bool>(!signaled); | 33 | return MakeResult<bool>(!signaled); |
| 34 | } | 34 | } |
| 35 | 35 | ||