SWDEV-559166 - Fix data races in GetSubmissionBatch, CaptureAndSet and SetQueueStatus (#1441)

This commit is contained in:
Ioannis Assiouras
2025-10-23 12:18:31 +01:00
zatwierdzone przez GitHub
rodzic e99bd0c783
commit 6d6b136374
9 zmienionych plików z 15 dodań i 16 usunięć
@@ -72,7 +72,7 @@ bool HostQueue::terminate() {
Command* lastCommand = getLastQueuedCommand(true);
if (lastCommand != nullptr) {
// Check if CPU batch wasn't flushed for completion with the last command
if (GetSubmissionBatch() != nullptr) {
if (GetSubmissionBatchSize() != 0) {
auto command = new Marker(*this, false);
if (command != nullptr) {
ClPrint(LOG_DETAIL_DEBUG, LOG_CMD, "Marker queued to ensure finish");
@@ -187,7 +187,7 @@ void HostQueue::finish(bool cpu_wait) {
batchSize, cpu_wait, vdev()->isFenceDirty());
// Force marker if the batch wasn't sent for CPU update or fence is dirty
if (nullptr == command || (GetSubmissionBatch() != nullptr) || vdev()->isFenceDirty()) {
if (nullptr == command || (batchSize != 0)|| vdev()->isFenceDirty()) {
if (nullptr != command) {
command->release();
}