[GPU] Short circuit command processor waits if an exit is requested.
This commit is contained in:
parent
d98344f99b
commit
29c5fb8022
|
@ -338,7 +338,7 @@ void CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Spin until no more pending swap.
|
// Spin until no more pending swap.
|
||||||
while (true) {
|
while (worker_running_) {
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||||
if (!swap_state_.pending) {
|
if (!swap_state_.pending) {
|
||||||
|
@ -827,11 +827,17 @@ bool CommandProcessor::ExecutePacketType3_WAIT_REG_MEM(RingBuffer* reader,
|
||||||
}
|
}
|
||||||
xe::threading::SyncMemory();
|
xe::threading::SyncMemory();
|
||||||
ReturnFromWait();
|
ReturnFromWait();
|
||||||
|
|
||||||
|
if (!worker_running_) {
|
||||||
|
// Short-circuited exit.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
xe::threading::MaybeYield();
|
xe::threading::MaybeYield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!matched);
|
} while (!matched);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue