summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-05-23 23:11:27 +0000
committerJason Molenda <jmolenda@apple.com>2014-05-23 23:11:27 +0000
commit4da8706e5d38a3facce02b870b3ba6f3f13ac36c (patch)
tree5c22d9b1952c8399171d6a622b4491392260c98c
parent771bb72aa7331bb23dee5296514bb3c98d19576c (diff)
downloadbcm5719-llvm-4da8706e5d38a3facce02b870b3ba6f3f13ac36c.tar.gz
bcm5719-llvm-4da8706e5d38a3facce02b870b3ba6f3f13ac36c.zip
Add a lock ivar to the Platform so that multiple Targets
trying to populate the list of trap handler names at the same time don't conflict with one another. <rdar://problem/17011969> llvm-svn: 209563
-rw-r--r--lldb/include/lldb/Target/Platform.h1
-rw-r--r--lldb/source/Target/Platform.cpp11
2 files changed, 9 insertions, 3 deletions
diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h
index 80011fd120d..e1e1c91d6fe 100644
--- a/lldb/include/lldb/Target/Platform.h
+++ b/lldb/include/lldb/Target/Platform.h
@@ -892,6 +892,7 @@ namespace lldb_private {
std::string m_local_cache_directory;
std::vector<ConstString> m_trap_handlers;
bool m_calculated_trap_handlers;
+ Mutex m_trap_handler_mutex;
//------------------------------------------------------------------
/// Ask the Platform subclass to fill in the list of trap handler names
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index d1e5cebc685..96f63ead89c 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -257,7 +257,8 @@ Platform::Platform (bool is_host) :
m_ssh_opts (),
m_ignores_remote_hostname (false),
m_trap_handlers(),
- m_calculated_trap_handlers (false)
+ m_calculated_trap_handlers (false),
+ m_trap_handler_mutex()
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
if (log)
@@ -1398,8 +1399,12 @@ Platform::GetTrapHandlerSymbolNames ()
{
if (!m_calculated_trap_handlers)
{
- CalculateTrapHandlerSymbolNames();
- m_calculated_trap_handlers = true;
+ Mutex::Locker locker (m_trap_handler_mutex);
+ if (!m_calculated_trap_handlers)
+ {
+ CalculateTrapHandlerSymbolNames();
+ m_calculated_trap_handlers = true;
+ }
}
return m_trap_handlers;
}
OpenPOWER on IntegriCloud