From c5f28e2a05f2ebff09e1cd02a5faa84369c5c655 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Mon, 6 Feb 2017 17:55:02 +0000 Subject: Switch std::call_once to llvm::call_once Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202 --- .../source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp index 8a440f2ed4e..f68576e6084 100644 --- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp @@ -15,6 +15,8 @@ #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Utility/Stream.h" +#include "llvm/Support/Threading.h" + #include using namespace lldb; @@ -39,9 +41,9 @@ void ScriptInterpreterNone::ExecuteInterpreterLoop() { } void ScriptInterpreterNone::Initialize() { - static std::once_flag g_once_flag; + static llvm::once_flag g_once_flag; - std::call_once(g_once_flag, []() { + llvm::call_once(g_once_flag, []() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), lldb::eScriptLanguageNone, CreateInstance); -- cgit v1.2.3