[Openmp-commits] [openmp] [Libomptarget] Remove global ctor and use reference counting (PR #80499)
Joseph Huber via Openmp-commits
openmp-commits at lists.llvm.org
Tue Feb 6 09:18:11 PST 2024
================
@@ -20,25 +20,37 @@
extern void llvm::omp::target::ompt::connectLibrary();
#endif
-__attribute__((constructor(101))) void init() {
+static std::mutex PluginMtx;
+static std::atomic<uint32_t> RefCount = 0;
----------------
jhuber6 wrote:
That seems more complicated to me, since we'd need to somehow put the reference count into it, whereas as far as I'm aware the protected object simply wraps a mutex around a single object.
https://github.com/llvm/llvm-project/pull/80499
More information about the Openmp-commits
mailing list