mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-15 09:30:05 +00:00
SVC: Wake up the thread after the delay in WaitSync1
This commit is contained in:
parent
7de1b02bc1
commit
38da198aa1
@ -120,9 +120,6 @@ static Result CloseHandle(Handle handle) {
|
|||||||
|
|
||||||
/// Wait for a handle to synchronize, timeout after the specified nanoseconds
|
/// Wait for a handle to synchronize, timeout after the specified nanoseconds
|
||||||
static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
|
static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
|
||||||
// TODO(bunnei): Do something with nano_seconds, currently ignoring this
|
|
||||||
bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated
|
|
||||||
|
|
||||||
SharedPtr<Kernel::Object> object = Kernel::g_handle_table.GetGeneric(handle);
|
SharedPtr<Kernel::Object> object = Kernel::g_handle_table.GetGeneric(handle);
|
||||||
if (object == nullptr)
|
if (object == nullptr)
|
||||||
return InvalidHandle(ErrorModule::Kernel).raw;
|
return InvalidHandle(ErrorModule::Kernel).raw;
|
||||||
@ -134,6 +131,8 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
|
|||||||
|
|
||||||
// Check for next thread to schedule
|
// Check for next thread to schedule
|
||||||
if (wait.Succeeded() && *wait) {
|
if (wait.Succeeded() && *wait) {
|
||||||
|
// Create an event to wake the thread up after the specified nanosecond delay has passed
|
||||||
|
Kernel::WakeThreadAfterDelay(Kernel::GetCurrentThread(), nano_seconds);
|
||||||
HLE::Reschedule(__func__);
|
HLE::Reschedule(__func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user