Kernel/Threads: Implement an SleepClientThread function for HLERequestContext-based services to make performing async tasks on the host while in an HLE service function easier.
An HLE service function that wants to perform an async operation should put the caller guest thread to sleep using SleepClientThread, passing in a callback to execute when the thread is resumed. SleepClientThread returns a Kernel::Event that should be signaled to resume the guest thread when the host async operation completes.
This commit is contained in:
parent
6050d000fa
commit
3d000c834b
4 changed files with 68 additions and 3 deletions
|
@ -196,7 +196,8 @@ static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) {
|
|||
}
|
||||
|
||||
if (thread->status == THREADSTATUS_WAIT_SYNCH_ANY ||
|
||||
thread->status == THREADSTATUS_WAIT_SYNCH_ALL || thread->status == THREADSTATUS_WAIT_ARB) {
|
||||
thread->status == THREADSTATUS_WAIT_SYNCH_ALL || thread->status == THREADSTATUS_WAIT_ARB ||
|
||||
thread->status == THREADSTATUS_WAIT_HLE_EVENT) {
|
||||
|
||||
// Invoke the wakeup callback before clearing the wait objects
|
||||
if (thread->wakeup_callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue