[llvm] [OFFLOAD] Improve resource management of the plugin (PR #187597)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 24 10:56:52 PDT 2026
================
@@ -86,10 +86,12 @@ struct L0LaunchEnvTy {
KernelPropertiesTy &KernelPR;
bool HalfNumThreads = false;
bool IsTeamsNDRange = false;
+ std::unique_lock<std::mutex> Lock;
----------------
fineg74 wrote:
It is required for automatic unlocking of Mtx mutex. For example, you acquire a mutex on line 461 but can return due to error on line 464 or 471 or 481 without unlocking the mutex. In addition in function launchKernelWithImmCmdList where the mutex is expected to be unlocked you can still return on error in lines 261, 269 before actually unlocking it. The alternative is to put unlock the mutex explicitly in all these cases
https://github.com/llvm/llvm-project/pull/187597
More information about the llvm-commits
mailing list