diff options
| author | 2015-01-18 01:27:46 -0500 | |
|---|---|---|
| committer | 2015-01-21 19:11:47 -0500 | |
| commit | 6643673f28b9273149fc945849a13ed832e9ef33 (patch) | |
| tree | 026410cf5b0b57d350ac979380307991646e546c /src/core/hle/kernel/timer.cpp | |
| parent | Kernel: Separate WaitSynchronization into Wait and Acquire methods. (diff) | |
| download | yuzu-6643673f28b9273149fc945849a13ed832e9ef33.tar.gz yuzu-6643673f28b9273149fc945849a13ed832e9ef33.tar.xz yuzu-6643673f28b9273149fc945849a13ed832e9ef33.zip | |
WaitSynchronizationN: Refactor to fix several bugs
- Separate wait checking from waiting the current thread
- Resume thread when wait_all=true only if all objects are available at once
- Set output to correct wait object index when there are duplicate handles
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 6497bb349..9f0fbafe2 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp | |||
| @@ -29,11 +29,11 @@ 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(unsigned index) override { | 32 | ResultVal<bool> Wait(bool wait_thread) override { |
| 33 | bool wait = !signaled; | 33 | bool wait = !signaled; |
| 34 | if (wait) { | 34 | if (wait && wait_thread) { |
| 35 | AddWaitingThread(GetCurrentThread()); | 35 | AddWaitingThread(GetCurrentThread()); |
| 36 | Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_TIMER, this, index); | 36 | Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_TIMER, this); |
| 37 | } | 37 | } |
| 38 | return MakeResult<bool>(wait); | 38 | return MakeResult<bool>(wait); |
| 39 | } | 39 | } |