summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/Host.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-07-28 17:32:20 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-07-28 17:32:20 +0000
commit2d6a9ec9351f974a19eeca4c2326ef9ff701ee37 (patch)
treee306e8382919dfd8618515a84b0cf9f495868bbf /lldb/source/Host/common/Host.cpp
parent5ed2b4ba1d87a8f06d7d9c5e7890d913edd44275 (diff)
downloadbcm5719-llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.tar.gz
bcm5719-llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.zip
Clean up vestigial remnants of locking primitives
This finally removes the use of the Mutex and Condition classes. This is an intricate patch as the Mutex and Condition classes were tied together. Furthermore, many places had slightly differing uses of time values. Convert timeout values to relative everywhere to permit the use of std::chrono::duration, which is required for the use of std::condition_variable's timeout. Adjust all Condition and related Mutex classes over to std::{,recursive_}mutex and std::condition_variable. This change primarily comes at the cost of breaking the TracingMutex which was based around the Mutex class. It would be possible to write a wrapper to provide similar functionality, but that is beyond the scope of this change. llvm-svn: 277011
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
-rw-r--r--lldb/source/Host/common/Host.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 5a02c33be83..c5dd105a59b 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -620,14 +620,8 @@ Host::RunShellCommand(const Args &args,
if (error.Success())
{
- TimeValue *timeout_ptr = nullptr;
- TimeValue timeout_time(TimeValue::Now());
- if (timeout_sec > 0) {
- timeout_time.OffsetWithSeconds(timeout_sec);
- timeout_ptr = &timeout_time;
- }
bool timed_out = false;
- shell_info_sp->process_reaped.WaitForValueEqualTo(true, timeout_ptr, &timed_out);
+ shell_info_sp->process_reaped.WaitForValueEqualTo(true, std::chrono::seconds(timeout_sec), &timed_out);
if (timed_out)
{
error.SetErrorString("timed out waiting for shell command to complete");
@@ -635,10 +629,8 @@ Host::RunShellCommand(const Args &args,
// Kill the process since it didn't complete within the timeout specified
Kill (pid, SIGKILL);
// Wait for the monitor callback to get the message
- timeout_time = TimeValue::Now();
- timeout_time.OffsetWithSeconds(1);
timed_out = false;
- shell_info_sp->process_reaped.WaitForValueEqualTo(true, &timeout_time, &timed_out);
+ shell_info_sp->process_reaped.WaitForValueEqualTo(true, std::chrono::seconds(1), &timed_out);
}
else
{
OpenPOWER on IntegriCloud