mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Fix another race condition with multithreading.
It's possible that after it's marked completed, the CPU will grab it to enqueue. This actually happened to mean with decent reproducibility.
This commit is contained in:
parent
2b50fcb016
commit
984bb31709
@ -663,8 +663,12 @@ void GPUCommon::ProcessDLQueueInternal() {
|
||||
return;
|
||||
} else {
|
||||
easy_guard guard(listLock);
|
||||
// At the end, we can remove it from the queue and continue.
|
||||
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
|
||||
|
||||
// Some other list could've taken the spot while we dilly-dallied around.
|
||||
if (l.state != PSP_GE_DL_STATE_QUEUED) {
|
||||
// At the end, we can remove it from the queue and continue.
|
||||
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
|
||||
}
|
||||
UpdateTickEstimate(std::max(busyTicks, startingTicks + cyclesExecuted));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user