diff options
author | bunnei <bunneidev@gmail.com> | 2014-08-06 18:30:01 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-08-06 18:30:01 -0400 |
commit | d0c179485392903fa413543d6b6908d45bc1f0fb (patch) | |
tree | a2e85ca4b091042e2e45446fda5b36bf6f62d2b3 /src/core/hle/kernel | |
parent | 90aaab1df0fe0a0518200c71df6ebe1bcf8eb783 (diff) | |
parent | 0805ecbaca70159ccc3d43c643b4ade7168795bc (diff) |
Merge pull request #34 from bunnei/gsp-command-synch
Gsp command synch
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/kernel/event.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/mutex.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.h | 6 |
5 files changed, 14 insertions, 5 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 61717bbe4..bdf76e0c2 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -53,7 +53,7 @@ Result ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 va for(int i = 0; i < value; i++) ArbitrateHighestPriorityThread(handle, address); } - HLE::Reschedule(__func__); + break; // Wait current thread (acquire the arbiter)... case ArbitrationType::WaitIfLessThan: @@ -61,6 +61,7 @@ Result ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 va Kernel::WaitCurrentThread(WAITTYPE_ARB, handle); HLE::Reschedule(__func__); } + break; default: ERROR_LOG(KERNEL, "unknown type=%d", type); diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 127c0cfc6..1e417e09c 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -42,7 +42,7 @@ public: if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) { waiting_threads.push_back(thread); } - Kernel::WaitCurrentThread(WAITTYPE_EVENT); + Kernel::WaitCurrentThread(WAITTYPE_EVENT, GetHandle()); } if (reset_type != RESETTYPE_STICKY && !permanent_locked) { locked = true; diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 1ccf1eb73..055f503f9 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -48,7 +48,7 @@ public: *wait = locked; if (locked) { - Kernel::WaitCurrentThread(WAITTYPE_MUTEX); + Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle()); } return 0; diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 86bbf29d0..1d7ded6f6 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -274,7 +274,11 @@ Thread* NextThread() { return Kernel::g_object_pool.GetFast<Thread>(next); } -/// Puts the current thread in the wait state for the given type +/** + * Puts the current thread in the wait state for the given type + * @param wait_type Type of wait + * @param wait_handle Handle of Kernel object that we are waiting on, defaults to current thread + */ void WaitCurrentThread(WaitType wait_type, Handle wait_handle) { Thread* thread = GetCurrentThread(); thread->wait_type = wait_type; diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f2bfdfa1a..39fa38b75 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -69,7 +69,11 @@ void ArbitrateAllThreads(u32 arbiter, u32 address); /// Gets the current thread handle Handle GetCurrentThreadHandle(); -/// Puts the current thread in the wait state for the given type +/** + * Puts the current thread in the wait state for the given type + * @param wait_type Type of wait + * @param wait_handle Handle of Kernel object that we are waiting on, defaults to current thread + */ void WaitCurrentThread(WaitType wait_type, Handle wait_handle=GetCurrentThreadHandle()); /// Put current thread in a wait state - on WaitSynchronization |