[Openmp-commits] [PATCH] D121060: [OpenMP][NFCI] Use RAII lock guards in libomptarget where possible

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 7 17:22:46 PST 2022


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/src/device.cpp:447
 
-  DataMapMtx.unlock();
   return Ret;
----------------
protze.joachim wrote:
> This unlock is gone without translating the lock to raii lock guard.
Good catch :) 


================
Comment at: openmp/libomptarget/src/omptarget.cpp:206
     if (AsyncInfo.synchronize() != OFFLOAD_SUCCESS)
       return OFFLOAD_FAIL;
   }
----------------
JonChesterfield wrote:
> Before this patch we left PendingGlobalsMtx locked here on the return. That's surely a bug, and I guess we don't hit it often because it's on a failure path. Fixed by this patch, which sadly seems to deadlock somewhere else.
Agreed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121060/new/

https://reviews.llvm.org/D121060



More information about the Openmp-commits mailing list