[llvm] [Offload] Do not do not re-initialize RPC server (PR #218757)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 20:55:37 PDT 2026


================
@@ -207,6 +207,12 @@ RPCServerTy::isDeviceUsingRPC(plugin::GenericDeviceTy &Device,
 Error RPCServerTy::initDevice(plugin::GenericDeviceTy &Device,
                               plugin::GenericGlobalHandlerTy &Handler,
                               plugin::DeviceImageTy &Image) {
+  {
+    std::lock_guard<decltype(BufferMutex)> Lock(BufferMutex);
+    if (Buffers[Device.getDeviceId()])
----------------
jhuber6 wrote:

Yeah, would probably be safest to just hold the lock the entire function, otherwise you could theoretically have two here.

https://github.com/llvm/llvm-project/pull/218757


More information about the llvm-commits mailing list