[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:41:49 PST 2024
    
    
  
JonChesterfield wrote:
It's weird to have a mutex and an atomic reference count. Suggest we drop the mutex and just reference count it. fetch_add or cas into it and finding a zero says you're the first thread to get there.
I think std::mutex has a constructor, in which case you're replacing a global ctor with a global ctor.
https://github.com/llvm/llvm-project/pull/80499
    
    
More information about the Openmp-commits
mailing list