1 //===--------------------- TimeSpecTimeout.cpp ------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "TimeSpecTimeout.h"
12 using namespace lldb_private;
14 const struct timespec *
15 TimeSpecTimeout::SetAbsoluteTimeoutMircoSeconds32 (uint32_t timeout_usec)
17 if (timeout_usec == UINT32_MAX)
24 TimeValue time_value(TimeValue::Now());
25 time_value.OffsetWithMicroSeconds(timeout_usec);
26 m_timespec = time_value.GetAsTimeSpec();
28 return GetTimeSpecPtr ();
31 const struct timespec *
32 TimeSpecTimeout::SetRelativeTimeoutMircoSeconds32 (uint32_t timeout_usec)
34 if (timeout_usec == UINT32_MAX)
42 time_value.OffsetWithMicroSeconds(timeout_usec);
43 m_timespec = time_value.GetAsTimeSpec();
45 return GetTimeSpecPtr ();