summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-04-03 04:24:32 +0000
committerDavide Italiano <davide@freebsd.org>2015-04-03 04:24:32 +0000
commitc8d69828ee47257d6324e68ee7c0107ca7247c4b (patch)
treebc98a6a8860c87f4961b58e97fab6995363186b8 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent10d362c51b6e222e212424521e315cab6453d1e2 (diff)
downloadbcm5719-llvm-c8d69828ee47257d6324e68ee7c0107ca7247c4b.tar.gz
bcm5719-llvm-c8d69828ee47257d6324e68ee7c0107ca7247c4b.zip
[Plugin/Process] Use std::call_once() to initialize.
This replaces the home-grown initialization mechanism used before. Differential Revision: http://reviews.llvm.org/D8760 llvm-svn: 233999
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 55964350b39..00cbb20aa81 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2958,16 +2958,15 @@ ProcessGDBRemote::KillDebugserverProcess ()
void
ProcessGDBRemote::Initialize()
{
- static bool g_initialized = false;
+ static std::once_flag g_once_flag;
- if (g_initialized == false)
+ std::call_once(g_once_flag, []()
{
- g_initialized = true;
PluginManager::RegisterPlugin (GetPluginNameStatic(),
GetPluginDescriptionStatic(),
CreateInstance,
DebuggerInitialize);
- }
+ });
}
void
OpenPOWER on IntegriCloud