mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
Demuxer improvement
This commit is contained in:
parent
5ea58d9451
commit
169fcd098b
5 changed files with 203 additions and 118 deletions
|
@ -79,12 +79,12 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
volatile u32 GetCount()
|
||||
volatile u32 GetCount() // may be not safe
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
volatile bool IsEmpty()
|
||||
volatile bool IsEmpty() // may be not safe
|
||||
{
|
||||
return !m_count;
|
||||
}
|
||||
|
@ -97,7 +97,28 @@ public:
|
|||
|
||||
T& Peek(u32 pos = 0)
|
||||
{
|
||||
SMutexLocker lock(m_mutex);
|
||||
while (true)
|
||||
{
|
||||
if (m_mutex.GetOwner() == m_mutex.GetDeadValue())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (!m_count)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
break;
|
||||
}
|
||||
Sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
SMutexLocker lock(m_mutex);
|
||||
if (m_count) break;
|
||||
}
|
||||
}
|
||||
return m_data[(m_pos + pos) % SQSize];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue