Skip to content

Commit

Permalink
deadlock when pausing/resuming quickly (android)
Browse files Browse the repository at this point in the history
Race condition when pausing/resuming is done from a separate thread (android): the renderer gets a result ready status for the previous emu thread, but waits on the newly created one forever.
  • Loading branch information
flyinghead committed Oct 25, 2024
1 parent 8108e63 commit e221f6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,8 @@ bool Emulator::checkStatus(bool wait)
std::unique_lock<std::mutex> lock(mutex);
if (threadResult.valid())
{
auto localResult = threadResult;
lock.unlock();
auto localResult = threadResult;
if (wait) {
localResult.wait();
}
Expand All @@ -997,8 +997,7 @@ bool Emulator::checkStatus(bool wait)
if (result == std::future_status::timeout)
return true;
}
lock.lock();
threadResult.get();
localResult.get();
}
return false;
} catch (...) {
Expand Down

1 comment on commit e221f6f

@chrisleigh-stack
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the folder picker can't play any Naomi games due folder restrictions.

Please sign in to comment.