[PATCH] D131510: [Orc] Reorder operations in ExecutorSharedMemoryMapperService shutdown

Anubhab Ghosh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 07:05:29 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0aaa74f7e6e5: [Orc] Reorder operations in ExecutorSharedMemoryMapperService shutdown (authored by argentite).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131510

Files:
  llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp


Index: llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
+++ llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
@@ -265,18 +265,21 @@
 
 Error ExecutorSharedMemoryMapperService::shutdown() {
   std::vector<ExecutorAddr> ReservationAddrs;
-  if (!Reservations.empty()) {
+  {
     std::lock_guard<std::mutex> Lock(Mutex);
-    {
-      ReservationAddrs.reserve(Reservations.size());
-      for (const auto &R : Reservations) {
-        ReservationAddrs.push_back(ExecutorAddr::fromPtr(R.getFirst()));
-      }
+
+    if (Reservations.empty())
+      return Error::success();
+
+    ReservationAddrs.reserve(Reservations.size());
+    for (const auto &R : Reservations) {
+      ReservationAddrs.push_back(ExecutorAddr::fromPtr(R.getFirst()));
     }
+
+    Reservations.clear();
   }
-  return release(ReservationAddrs);
 
-  return Error::success();
+  return release(ReservationAddrs);
 }
 
 void ExecutorSharedMemoryMapperService::addBootstrapSymbols(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131510.451844.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220811/4ea9e040/attachment.bin>


More information about the llvm-commits mailing list