mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04: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
1 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue