mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 07:51:28 +12:00
CHECK_EMU_STATUS, autojoin_thread_t
This commit is contained in:
parent
8f9e1100c8
commit
3064cf8101
28 changed files with 145 additions and 179 deletions
|
@ -609,10 +609,19 @@ u32 SPUThread::get_ch_value(u32 ch)
|
|||
|
||||
case SPU_RdEventStat:
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mutex, std::defer_lock);
|
||||
|
||||
u32 result;
|
||||
while (!(result = ch_event_stat.load() & ch_event_mask) && !Emu.IsStopped())
|
||||
|
||||
while ((result = ch_event_stat.load() & ch_event_mask) == 0)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
if (IsStopped()) throw CPUThreadStop{};
|
||||
|
||||
if (!lock) lock.lock();
|
||||
|
||||
cv.wait_for(lock, std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue