From 7c435a5ede460ef8e060f0bcb0aba8064137f922 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Thu, 6 Feb 2014 22:25:20 +0000 Subject: [PATCH] Lock the JIT before using it. llvm-svn: 200951 --- lldb/source/Expression/IRExecutionUnit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index 4d5c78e19b57..17bd03ae6cb5 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -238,6 +238,8 @@ IRExecutionUnit::GetRunnableInfo(Error &error, { lldb::ProcessSP process_sp(GetProcessWP().lock()); + static Mutex s_runnable_info_mutex(Mutex::Type::eMutexTypeRecursive); + func_addr = LLDB_INVALID_ADDRESS; func_end = LLDB_INVALID_ADDRESS; @@ -256,6 +258,8 @@ IRExecutionUnit::GetRunnableInfo(Error &error, return; }; + Mutex::Locker runnable_info_mutex_locker(s_runnable_info_mutex); + m_did_jit = true; Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));