mirror of https://github.com/PCSX2/pcsx2.git
gsdx: Use lock instead of loop to terminate threads
This commit is contained in:
parent
b244de73ca
commit
a583fafa37
|
@ -44,10 +44,9 @@ private:
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
while (m_count == 0) {
|
while (m_count == 0) {
|
||||||
if (m_exit.load(memory_order_relaxed)) {
|
if (m_exit.load(memory_order_relaxed))
|
||||||
m_exit = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
m_notempty.wait(l);
|
m_notempty.wait(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,10 +86,11 @@ public:
|
||||||
|
|
||||||
~GSJobQueue()
|
~GSJobQueue()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> l(m_lock);
|
||||||
m_exit = true;
|
m_exit = true;
|
||||||
do {
|
}
|
||||||
m_notempty.notify_one();
|
m_notempty.notify_one();
|
||||||
} while (m_exit);
|
|
||||||
|
|
||||||
m_thread.join();
|
m_thread.join();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue