[Lldb-commits] [lldb] [lldb] Implement coalescing of disjoint progress events (PR #84854)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 12 10:48:49 PDT 2024


================
@@ -0,0 +1,88 @@
+//===-- Alarm.h -------------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_HOST_ALARM_H
+#define LLDB_HOST_ALARM_H
+
+#include "lldb/Host/HostThread.h"
+#include "lldb/lldb-types.h"
+#include "llvm/Support/Chrono.h"
+
+namespace lldb_private {
+
+class Alarm {
+public:
+  using Handle = uint64_t;
+  using Callback = std::function<void()>;
+  using TimePoint = llvm::sys::TimePoint<>;
+  using Duration = std::chrono::milliseconds;
+
+  Alarm(Duration timeout, bool run_callback_on_exit = false);
+  ~Alarm();
+
+  Handle Create(Callback callback);
----------------
adrian-prantl wrote:

Maybe in the toplevel doxygen comment explain what the expected flow is, ie, that one Alarm can deal with multiple handles and what the expected behavior is?

https://github.com/llvm/llvm-project/pull/84854


More information about the lldb-commits mailing list