[all-commits] [llvm/llvm-project] 66784d: [OpenMP] Ensure `Devices` is accessed exlusively (...
Johannes Doerfert via All-commits
all-commits at lists.llvm.org
Mon Dec 4 17:10:51 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 66784dcb3b4302cea606c3e74913350197b7ed45
https://github.com/llvm/llvm-project/commit/66784dcb3b4302cea606c3e74913350197b7ed45
Author: Johannes Doerfert <johannes at jdoerfert.de>
Date: 2023-12-04 (Mon, 04 Dec 2023)
Changed paths:
M openmp/libomptarget/include/PluginManager.h
M openmp/libomptarget/include/Shared/Debug.h
M openmp/libomptarget/include/device.h
M openmp/libomptarget/src/OpenMP/InteropAPI.cpp
M openmp/libomptarget/src/PluginManager.cpp
M openmp/libomptarget/src/api.cpp
M openmp/libomptarget/src/device.cpp
M openmp/libomptarget/src/interface.cpp
M openmp/libomptarget/src/omptarget.cpp
Log Message:
-----------
[OpenMP] Ensure `Devices` is accessed exlusively (#74374)
We accessed the `Devices` container most of the time while holding the
RTLsMtx, but not always. Sometimes we used the mutex for the size query,
but then accessed Devices again unguarded. From now we properly
encapsulate the container in a ProtectedObj which ensures exclusive
accesses. We also hide the "isReady" part in the `getDevice` accessor
and use an `llvm::Expected` to allow to return errors.
More information about the All-commits
mailing list