https://bugs.llvm.org/show_bug.cgi?id=43632

            Bug ID: 43632
           Summary: local static object not Thread safe on Ubuntu 16 clang
                    3.7
           Product: libc++
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Hi, 

We are using Clang 3.7 with flag -- -std=c++14
We found an issue with Singleton thread safe.

In our code we implemented “Meyers Singleton” as described in 
https://www.modernescpp.com/index.php/thread-safe-initialization-of-data
This is thread safe implementation guaranteed by std C++ 11 and has by far
better performance according to
https://www.modernescpp.com/index.php/thread-safe-initialization-of-a-singleton

However,  this implementation is not thread safe if using libc++ 11
compilation, as we happen to know now, and we had to add a lock_guard to
overcome this issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to