Similar to Java (PR #1112 ), C++ code also has the problem of concurrent initialization of singletons by multiple threads.