mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-26 12:16:20 +00:00
Merge pull request #3794 from EmptyChaos/frame-advance-race
Core: Add synchronization to state changes (Fix Frame Step and FIFO Player - Issue 8718)
This commit is contained in:
commit
08d45b9fea
36 changed files with 992 additions and 415 deletions
|
@ -83,6 +83,7 @@ enum HOST_COMM
|
|||
WM_USER_STOP = 10,
|
||||
WM_USER_CREATE,
|
||||
WM_USER_SETCURSOR,
|
||||
WM_USER_JOB_DISPATCH,
|
||||
};
|
||||
|
||||
// Used for notification on emulation state
|
||||
|
|
|
@ -42,8 +42,7 @@ public:
|
|||
return;
|
||||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
m_condvar.wait(lk, [&]{ return m_flag.IsSet(); });
|
||||
m_flag.Clear();
|
||||
m_condvar.wait(lk, [&]{ return m_flag.TestAndClear(); });
|
||||
}
|
||||
|
||||
template<class Rep, class Period>
|
||||
|
@ -54,8 +53,7 @@ public:
|
|||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
bool signaled = m_condvar.wait_for(lk, rel_time,
|
||||
[&]{ return m_flag.IsSet(); });
|
||||
m_flag.Clear();
|
||||
[&]{ return m_flag.TestAndClear(); });
|
||||
|
||||
return signaled;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue