summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-09 20:22:01 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-09 20:22:01 +0000
commit0cd70866041cb69b52e51ac0a486e16aee3ae84a (patch)
tree3aa8c6eae52f42dbc99c5504da7e656314e3d6c4 /lldb/source/API
parent3ad11ff90f115a11149c5abe04d46579ff387ebd (diff)
downloadbcm5719-llvm-0cd70866041cb69b52e51ac0a486e16aee3ae84a.tar.gz
bcm5719-llvm-0cd70866041cb69b52e51ac0a486e16aee3ae84a.zip
<rdar://problem/11202426>
Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause. llvm-svn: 154339
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBDebugger.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index b61acd75f62..4c62ffb2c02 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -143,7 +143,12 @@ SBDebugger::Destroy (SBDebugger &debugger)
void
SBDebugger::MemoryPressureDetected ()
{
- ModuleList::RemoveOrphanSharedModules();
+ // Since this function can be call asynchronously, we allow it to be
+ // non-mandatory. We have seen deadlocks with this function when called
+ // so we need to safeguard against this until we can determine what is
+ // causing the deadlocks.
+ const bool mandatory = false;
+ ModuleList::RemoveOrphanSharedModules(mandatory);
}
SBDebugger::SBDebugger () :
@@ -648,7 +653,8 @@ SBDebugger::DeleteTarget (lldb::SBTarget &target)
result = m_opaque_sp->GetTargetList().DeleteTarget (target_sp);
target_sp->Destroy();
target.Clear();
- ModuleList::RemoveOrphanSharedModules();
+ const bool mandatory = true;
+ ModuleList::RemoveOrphanSharedModules(mandatory);
}
}
OpenPOWER on IntegriCloud