summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 531b56c503e..61da768995e 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -4228,11 +4228,27 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
if (single_thread_timeout_usec != 0)
{
+ // we have a > 0 timeout, let us set it so that we stop after the deadline
real_timeout = TimeValue::Now();
real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec);
timeout_ptr = &real_timeout;
}
+ else if (first_timeout)
+ {
+ // if we are willing to wait "forever" we still need to have an initial timeout
+ // this timeout is going to induce all threads to run when hit. we do this so that
+ // we can avoid ending locked up because of multithreaded contention issues
+ real_timeout = TimeValue::Now();
+ real_timeout.OffsetWithNanoSeconds(500000000UL);
+ timeout_ptr = &real_timeout;
+ }
+ else
+ {
+ timeout_ptr = NULL; // if we are in a no-timeout scenario, then we only need a fake timeout the first time through
+ // at this point in the code, all threads will be running so we are willing to wait forever, and do not
+ // need a timeout
+ }
}
else
{
OpenPOWER on IntegriCloud