// C Includes
// C++ Includes
+#include <mutex>
// Other libraries and framework includes
// Project includes
#include "lldb/Target/Process.h"
Process::GetGlobalProperties()
{
static ProcessPropertiesSP g_settings_sp;
- if (!g_settings_sp)
- g_settings_sp.reset (new ProcessProperties (NULL));
+ static std::once_flag g_once_flag;
+ std::call_once(g_once_flag, []() {
+ if (!g_settings_sp)
+ g_settings_sp.reset (new ProcessProperties (NULL));
+ });
return g_settings_sp;
}
// C Includes
// C++ Includes
+#include <mutex>
// Other libraries and framework includes
// Project includes
#include "lldb/Target/Target.h"
Target::GetGlobalProperties()
{
static TargetPropertiesSP g_settings_sp;
- if (!g_settings_sp)
- {
- g_settings_sp.reset(new TargetProperties(nullptr));
- }
+ static std::once_flag g_once_flag;
+ std::call_once(g_once_flag, []() {
+ if (!g_settings_sp)
+ g_settings_sp.reset(new TargetProperties(nullptr));
+ });
return g_settings_sp;
}
// C Includes
// C++ Includes
+#include <mutex>
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
Thread::GetGlobalProperties()
{
static ThreadPropertiesSP g_settings_sp;
- if (!g_settings_sp)
- g_settings_sp.reset (new ThreadProperties (true));
+ static std::once_flag g_once_flag;
+ std::call_once(g_once_flag, []() {
+ if (!g_settings_sp)
+ g_settings_sp.reset (new ThreadProperties (true));
+ });
return g_settings_sp;
}