class Timeout : public llvm::Optional<std::chrono::duration<int64_t, Ratio>> {
private:
template <typename Ratio2> using Dur = std::chrono::duration<int64_t, Ratio2>;
- template <typename Ratio2>
+ template <typename Rep2, typename Ratio2>
using EnableIf = std::enable_if<
- std::is_convertible<std::chrono::duration<int64_t, Ratio2>,
+ std::is_convertible<std::chrono::duration<Rep2, Ratio2>,
std::chrono::duration<int64_t, Ratio>>::value>;
using Base = llvm::Optional<Dur<Ratio>>;
Timeout(llvm::NoneType none) : Base(none) {}
Timeout(const Timeout &other) = default;
- template <typename Ratio2, typename = typename EnableIf<Ratio2>::type>
+ template <typename Ratio2,
+ typename = typename EnableIf<int64_t, Ratio2>::type>
Timeout(const Timeout<Ratio2> &other)
: Base(other ? Base(Dur<Ratio>(*other)) : llvm::None) {}
- template <typename Ratio2, typename = typename EnableIf<Ratio2>::type>
- Timeout(const Dur<Ratio2> &other) : Base(Dur<Ratio>(other)) {}
+ template <typename Rep2, typename Ratio2,
+ typename = typename EnableIf<Rep2, Ratio2>::type>
+ Timeout(const std::chrono::duration<Rep2, Ratio2> &other)
+ : Base(Dur<Ratio>(other)) {}
};
class GDBRemoteCommunication : public Communication {
}
PacketResult GetPacket(StringExtractorGDBRemote &response) {
- const unsigned timeout_usec = 1000000; // 1s
const bool sync_on_timeout = false;
- return WaitForPacketWithTimeoutMicroSecondsNoLock(response, timeout_usec,
- sync_on_timeout);
+ return WaitForPacketNoLock(response, std::chrono::seconds(1),
+ sync_on_timeout);
}
using GDBRemoteCommunicationServer::SendOKResponse;