diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp index 81634ae1edc49..92a4b66955c7a 100644 --- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp @@ -1093,7 +1093,10 @@ struct AMDGPUStreamTy { if (Queue == nullptr) return Plugin::error("Target queue was nullptr"); - /// The signal that we must wait from the other stream. + // Guard access to the Slots data structure. + std::lock_guard Lock(Mutex); + + // The signal that we must wait from the other stream. AMDGPUSignalTy *OtherSignal = OtherStream.Slots[Slot].Signal; // Prevent the release of the other stream's signal.