Use Timeout<> in the Listener class
Summary:
Communication classes use the Timeout<> class to specify the timeout. Listener
class was converted to chrono some time ago, but it used a different meaning for
a timeout of zero (Listener: infinite wait, Communication: no wait). Instead,
Listener provided separate functions which performed a non-blocking event read.
This converts the Listener class to the new Timeout class, to improve
consistency. It also allows us to get merge the different GetNextEvent*** and
WaitForEvent*** functions into one. No functional change intended.
Reviewers: jingham, clayborg, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D27136
llvm-svn: 288238
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index e66fb23..8f888a5 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1535,7 +1535,7 @@
bool done = false;
while (!done) {
EventSP event_sp;
- if (listener_sp->WaitForEvent(std::chrono::microseconds(0), event_sp)) {
+ if (listener_sp->GetEvent(event_sp, llvm::None)) {
if (event_sp) {
Broadcaster *broadcaster = event_sp->GetBroadcaster();
if (broadcaster) {
@@ -1616,7 +1616,7 @@
// to wait an infinite amount of time for it (nullptr timeout as the first
// parameter)
lldb::EventSP event_sp;
- listener_sp->WaitForEvent(std::chrono::microseconds(0), event_sp);
+ listener_sp->GetEvent(event_sp, llvm::None);
}
return m_event_handler_thread.IsJoinable();
}