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

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 7 06:05:40 PST 2022


JonChesterfield added a comment.

Found one error in the existing code but can believe there are more. We could split this patch into two, one replacing the DIY LockGuard with std::lock_guard and clang-format the thing, then a second replacing manual locking with uses of lock guard. Would be the same behaviour as this patch but make it easier to find the change in behaviour by inspection.



================
Comment at: openmp/libomptarget/src/omptarget.cpp:206
     if (AsyncInfo.synchronize() != OFFLOAD_SUCCESS)
       return OFFLOAD_FAIL;
   }
----------------
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.


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