From 01a98af09882aa416f6c90060b472c27ef3d4bf5 Mon Sep 17 00:00:00 2001 From: DH Date: Thu, 13 Jul 2023 14:44:57 +0300 Subject: [PATCH] [rpcsx-os] Wake umtx on thr_exit --- rpcsx-os/ops.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpcsx-os/ops.cpp b/rpcsx-os/ops.cpp index d07dfde9..d672ca62 100644 --- a/rpcsx-os/ops.cpp +++ b/rpcsx-os/ops.cpp @@ -4,6 +4,7 @@ #include "orbis/module/ModuleHandle.hpp" #include "orbis/thread/Process.hpp" #include "orbis/thread/Thread.hpp" +#include "orbis/umtx.hpp" #include "orbis/utils/Rc.hpp" #include "thread.hpp" #include "vfs.hpp" @@ -492,7 +493,10 @@ SysResult thr_new(orbis::Thread *thread, orbis::ptr param, SysResult thr_exit(orbis::Thread *thread, orbis::ptr state) { std::printf("Requested exit of thread %u, state %p\n", (unsigned)thread->tid, state); - // FIXME: do sys_mtx(WAKE) if state is not null + if (state != nullptr) { + static_cast(uwrite(state, (orbis::slong)1)); + umtx_wake(thread, state, INT_MAX); + } // FIXME: implement exit while (true) {