diff options
| author | Pavel Labath <labath@google.com> | 2016-11-25 11:58:44 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2016-11-25 11:58:44 +0000 |
| commit | c4063eee0d9ad122bb346a6c9a8e9546e24c1291 (patch) | |
| tree | ccb88653e0257b85b225a6898314fbc3ffe1eb01 /lldb/source/API | |
| parent | 8424b03d002ab3069192d0ba5bac32168df228e9 (diff) | |
| download | bcm5719-llvm-c4063eee0d9ad122bb346a6c9a8e9546e24c1291.tar.gz bcm5719-llvm-c4063eee0d9ad122bb346a6c9a8e9546e24c1291.zip | |
Introduce chrono to the Communication class
This replaces the raw integer timeout parameters in the class with their
chrono-based equivalents. To achieve this, I have moved the Timeout class to a
more generic place and added a quick unit test for it.
llvm-svn: 287920
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBCommunication.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/API/SBCommunication.cpp b/lldb/source/API/SBCommunication.cpp index f80b114e222..9519c02f7e2 100644 --- a/lldb/source/API/SBCommunication.cpp +++ b/lldb/source/API/SBCommunication.cpp @@ -119,8 +119,11 @@ size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec, static_cast<void *>(m_opaque), static_cast<void *>(dst), static_cast<uint64_t>(dst_len), timeout_usec); size_t bytes_read = 0; + Timeout<std::micro> timeout = timeout_usec == UINT32_MAX + ? Timeout<std::micro>(llvm::None) + : std::chrono::microseconds(timeout_usec); if (m_opaque) - bytes_read = m_opaque->Read(dst, dst_len, timeout_usec, status, NULL); + bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL); else status = eConnectionStatusNoConnection; |

