summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/hle_ipc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-17 16:07:57 +0200
committerGitHub <noreply@github.com>2018-07-17 16:07:57 +0200
commit5f119bed56d20f73131b5ed51844637f92b12804 (patch)
treeab2c73b4cd29b32e6c79c0274d65fe7cee7f6070 /src/core/hle/kernel/hle_ipc.cpp
parentMerge pull request #669 from lioncash/dynarmic (diff)
parentnvflinger: Fix for BufferQueue event handling. (diff)
downloadyuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar.gz
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar.bz2
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar.lz
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar.xz
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.tar.zst
yuzu-5f119bed56d20f73131b5ed51844637f92b12804.zip
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 2532dd450..b1e6f565b 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -29,7 +29,8 @@ void SessionRequestHandler::ClientDisconnected(SharedPtr<ServerSession> server_s
SharedPtr<Event> HLERequestContext::SleepClientThread(SharedPtr<Thread> thread,
const std::string& reason, u64 timeout,
- WakeupCallback&& callback) {
+ WakeupCallback&& callback,
+ Kernel::SharedPtr<Kernel::Event> event) {
// Put the client thread to sleep until the wait event is signaled or the timeout expires.
thread->wakeup_callback =
@@ -41,7 +42,12 @@ SharedPtr<Event> HLERequestContext::SleepClientThread(SharedPtr<Thread> thread,
return true;
};
- auto event = Kernel::Event::Create(Kernel::ResetType::OneShot, "HLE Pause Event: " + reason);
+ if (!event) {
+ // Create event if not provided
+ event = Kernel::Event::Create(Kernel::ResetType::OneShot, "HLE Pause Event: " + reason);
+ }
+
+ event->Clear();
thread->status = THREADSTATUS_WAIT_HLE_EVENT;
thread->wait_objects = {event};
event->AddWaitingThread(thread);