diff options
author | Kevin Hartman <kevin@hart.mn> | 2015-01-26 07:56:17 +0100 |
---|---|---|
committer | Kevin Hartman <kevin@hart.mn> | 2015-02-10 06:47:12 +0100 |
commit | 5fcbfc06eb247c0a4c1db201ac9050d80d4e4020 (patch) | |
tree | 4cdac59449b025c7a07e8655f29eda2fbcb423fe /src/core/hle/svc.cpp | |
parent | Merge pull request #551 from bunnei/mutex-fixes (diff) | |
download | yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar.gz yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar.bz2 yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar.lz yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar.xz yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.tar.zst yuzu-5fcbfc06eb247c0a4c1db201ac9050d80d4e4020.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/svc.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index c4866fcce..96da29923 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -150,7 +150,7 @@ static ResultCode WaitSynchronization1(Handle handle, s64 nano_seconds) { if (object->ShouldWait()) { object->AddWaitingThread(Kernel::GetCurrentThread()); - Kernel::WaitCurrentThread_WaitSynchronization(object, false, false); + Kernel::WaitCurrentThread_WaitSynchronization({ object }, false, false); // Create an event to wake the thread up after the specified nanosecond delay has passed Kernel::GetCurrentThread()->WakeAfterDelay(nano_seconds); @@ -212,7 +212,6 @@ static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_cou // NOTE: This should deadlock the current thread if no timeout was specified if (!wait_all) { wait_thread = true; - Kernel::WaitCurrentThread_WaitSynchronization(nullptr, true, wait_all); } } @@ -222,12 +221,17 @@ static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_cou if (wait_thread) { // Actually wait the current thread on each object if we decided to wait... + std::vector<SharedPtr<Kernel::WaitObject>> wait_objects; + wait_objects.reserve(handle_count); + for (int i = 0; i < handle_count; ++i) { auto object = Kernel::g_handle_table.GetWaitObject(handles[i]); object->AddWaitingThread(Kernel::GetCurrentThread()); - Kernel::WaitCurrentThread_WaitSynchronization(object, true, wait_all); + wait_objects.push_back(object); } + Kernel::WaitCurrentThread_WaitSynchronization(std::move(wait_objects), true, wait_all); + // Create an event to wake the thread up after the specified nanosecond delay has passed Kernel::GetCurrentThread()->WakeAfterDelay(nano_seconds); @@ -319,7 +323,7 @@ static ResultCode CreateThread(u32* out_handle, u32 priority, u32 entry_point, u } CASCADE_RESULT(SharedPtr<Thread> thread, Kernel::Thread::Create( - name, entry_point, priority, arg, processor_id, stack_top, Kernel::DEFAULT_STACK_SIZE)); + name, entry_point, priority, arg, processor_id, stack_top)); CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(thread))); LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " @@ -338,7 +342,7 @@ static ResultCode CreateThread(u32* out_handle, u32 priority, u32 entry_point, u static void ExitThread() { LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::g_app_core->GetPC()); - Kernel::GetCurrentThread()->Stop(__func__); + Kernel::GetCurrentThread()->Stop(); HLE::Reschedule(__func__); } |