[Openmp-commits] [openmp] [Libomptarget] Remove global ctor and use reference counting (PR #80499)

Jon Chesterfield via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 21 06:44:12 PST 2024


================
@@ -48,7 +48,8 @@ void deinitRuntime() {
   std::scoped_lock<decltype(PluginMtx)> Lock(PluginMtx);
   assert(PM && "Runtime not initialized");
 
-  if (RefCount-- == 0) {
+  RefCount--;
----------------
JonChesterfield wrote:

This looks wrong - you're separating the decrement from the load, should be a fetch_sub followed by a branch on the old value

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


More information about the Openmp-commits mailing list