SWDEV-474091 – Fix sporadic crash in streamcallback test

Also in the scope of SWDEV-467540.
Fix sporadic crash in Unit_hipStreamAddCallback_MultipleThreads by
deferring release() of block_command.
The test will invoke 1000 threads on the same stream thus there
is a chance to free block_command too early in original code.
By deferring release() of block_command we can make sure block_command
is always valid during calling block_command->notifyCmdQueue().

Change-Id: I31555ee18e6958e34b89f04181867fa4e932a38c


[ROCm/clr commit: e3ef19e22a]
This commit is contained in:
taosang2
2024-07-19 13:12:07 -04:00
committed by Tao Sang
parent 30a4b9e316
commit f33637b1c6
+1 -1
View File
@@ -581,13 +581,13 @@ hipError_t streamCallback_common(hipStream_t stream, StreamCallback* cbo, void*
return hipErrorInvalidValue;
}
block_command->enqueue();
block_command->release();
// Release the callback marker
command->release();
// Notify the command queue about a possible waiter for the calback
block_command->notifyCmdQueue();
block_command->release();
return hipSuccess;
}