Fix builds Windows and OSX builds after Connection refactor in r287922
Switch various bits of platform-specific code to chrono that I did not notice when doing a linux build. This exposed a bug that ConnectionGenericFileWindows did not handle the magic UINT32_MAX timeout value (instead it waited for about an hour, which is close enough I guess). Fix that as well. llvm-svn: 287927
This commit is contained in:
@@ -168,7 +168,7 @@ lldb::ConnectionStatus ConnectionGenericFile::Disconnect(Error *error_ptr) {
|
||||
}
|
||||
|
||||
size_t ConnectionGenericFile::Read(void *dst, size_t dst_len,
|
||||
uint32_t timeout_usec,
|
||||
const Timeout<std::micro> &timeout,
|
||||
lldb::ConnectionStatus &status,
|
||||
Error *error_ptr) {
|
||||
ReturnInfo return_info;
|
||||
@@ -191,7 +191,11 @@ size_t ConnectionGenericFile::Read(void *dst, size_t dst_len,
|
||||
// The expected return path. The operation is pending. Wait for the
|
||||
// operation to complete
|
||||
// or be interrupted.
|
||||
DWORD milliseconds = timeout_usec/1000;
|
||||
DWORD milliseconds =
|
||||
timeout
|
||||
? std::chrono::duration_cast<std::chrono::milliseconds>(*timeout)
|
||||
.count()
|
||||
: INFINITE;
|
||||
DWORD wait_result =
|
||||
::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles),
|
||||
m_event_handles, FALSE, milliseconds);
|
||||
|
||||
Reference in New Issue
Block a user