core/command_queue_mt: Fix crash/hang when buffer fills up
This patch fixes two related issues. One is the race condition in issue #42107.. The other is a crash which happens when the reader is lapped near the end of the buffer.
This commit is contained in:
parent
48e8da4aac
commit
9f654b441f
2 changed files with 21 additions and 7 deletions
|
|
@ -72,7 +72,7 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() {
|
|||
|
||||
bool CommandQueueMT::dealloc_one() {
|
||||
tryagain:
|
||||
if (dealloc_ptr == write_ptr) {
|
||||
if (dealloc_ptr == (write_ptr_and_epoch >> 1)) {
|
||||
// The queue is empty
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue