Lines Matching +full:cancel +full:- +full:in +full:- +full:progress

1 //===-- Progress.cpp ------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Core/Progress.h"
23 std::atomic<uint64_t> Progress::g_id(0);
25 // Instrument progress events with signposts when supported.
28 Progress::Progress(std::string title, std::string details,
32 Progress::Origin origin)
33 : m_total(total.value_or(Progress::kNonDeterministicTotal)),
36 debugger ? std::optional<user_id_t>(debugger->GetID())
52 g_progress_signposts->startInterval(this, m_progress_data.title);
55 Progress::~Progress() {
57 g_progress_signposts->endInterval(this, m_progress_data.title);
59 // Make sure to always report progress completed when this object is
60 // destructed so it indicates the progress dialog/activity should go away.
70 void Progress::Increment(uint64_t amount,
100 void Progress::ReportProgress() {
109 return; // An overflow in the m_completed counter. Just ignore these events.
111 // Change the category bit if we're an internal or external progress.
113 m_progress_data.origin == Progress::Origin::eExternal
150 void ProgressManager::Increment(const Progress::ProgressData &progress_data) {
158 // This is a new progress event. Report progress and store the progress
164 // came in before the timer expired.
167 if (!m_alarm.Cancel(entry.handle)) {
168 // The timer expired before we had a chance to cancel it. We have to treat
169 // this as an entirely new progress event.
180 void ProgressManager::Decrement(const Progress::ProgressData &progress_data) {
188 Entry &entry = it->second;
189 entry.refcount--;
199 // Start a timer. If it expires before we see another progress event, it
206 const Progress::ProgressData &progress_data, EventType type) {
207 // The category bit only keeps track of when progress report categories have
211 (type == EventType::Begin) ? 0 : Progress::kNonDeterministicTotal;
213 progress_data.origin == Progress::Origin::eExternal
217 completed, Progress::kNonDeterministicTotal,
228 // A new event came in and the alarm fired before we had a chance to restart