================
@@ -380,6 +380,18 @@ def wait_for_event(self, filter=None, timeout=None):
             )
         return None
 
+    def wait_for_events(self, events, timeout=None):
+        """Wait for a list of events in `events` in any order.
+        Return the events not hit before the timeout expired"""
+        events = events[:]  # Make a copy to avoid modifying the input
+        end_time = time.time() + timeout if timeout else None
+        while events and (not end_time or end_time > time.time()):
+            event_dict = self.wait_for_event(filter=events, timeout=timeout)
+            if not event_dict:
+                continue
+            events.remove(event_dict["event"])
----------------
kusmour wrote:

It should be fine. But in this case we reset the timeout on every call waiting 
for any single event in the filter. So it's possible that it takes longer than 
the `timeout` to get all events.

https://github.com/llvm/llvm-project/pull/137278
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to