diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | |
parent | d61b076ede88b56f3372a55e7d1eac6a9d717120 (diff) | |
download | FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz |
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp')
-rw-r--r-- | source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 5a0b5ed..a0458f1 100644 --- a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -11,6 +11,8 @@ #include <errno.h> // C++ Includes +#include <mutex> + // Other libraries and framework includes #include "lldb/Core/PluginManager.h" #include "lldb/Core/State.h" @@ -56,23 +58,14 @@ ProcessFreeBSD::CreateInstance(Target& target, void ProcessFreeBSD::Initialize() { - static bool g_initialized = false; + static std::once_flag g_once_flag; - if (!g_initialized) - { + std::call_once(g_once_flag, []() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); - Log::Callbacks log_callbacks = { - ProcessPOSIXLog::DisableLog, - ProcessPOSIXLog::EnableLog, - ProcessPOSIXLog::ListLogCategories - }; - - Log::RegisterLogChannel (ProcessFreeBSD::GetPluginNameStatic(), log_callbacks); - ProcessPOSIXLog::RegisterPluginName(GetPluginNameStatic()); - g_initialized = true; - } + ProcessPOSIXLog::Initialize(GetPluginNameStatic()); + }); } lldb_private::ConstString |