Skip to content

[lldb][progress] Always report progress upon Progress object destruction #73605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

chelcassanova
Copy link
Contributor

This commit allows a final progress report upon the destruction of the Progress object to happen at all times as opposed to when the progress was not completed.

This commit allows a final progress report upon the destruction of the
`Progress` object to happen at all times as opposed to when the progress
was not completed
@llvmbot
Copy link
Member

llvmbot commented Nov 28, 2023

@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)

Changes

This commit allows a final progress report upon the destruction of the Progress object to happen at all times as opposed to when the progress was not completed.


Full diff: https://github.com/llvm/llvm-project/pull/73605.diff

1 Files Affected:

  • (modified) lldb/source/Core/Progress.cpp (+1-1)
diff --git a/lldb/source/Core/Progress.cpp b/lldb/source/Core/Progress.cpp
index 08be73f1470f349..eee4d3955154ba9 100644
--- a/lldb/source/Core/Progress.cpp
+++ b/lldb/source/Core/Progress.cpp
@@ -32,8 +32,8 @@ Progress::~Progress() {
   std::lock_guard<std::mutex> guard(m_mutex);
   if (!m_completed) {
     m_completed = m_total;
-    ReportProgress();
   }
+  ReportProgress();
 }
 
 void Progress::Increment(uint64_t amount, std::string update) {

Copy link
Member

@medismailben medismailben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comment.

Comment on lines 33 to 35
if (!m_completed) {
m_completed = m_total;
ReportProgress();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chelcassanova chelcassanova merged commit c846f8b into llvm:main Nov 28, 2023
chelcassanova added a commit to chelcassanova/llvm-project that referenced this pull request Nov 28, 2023
…ion (llvm#73605)

This commit allows a final progress report upon the destruction of the
`Progress` object to happen at all times as opposed to when the progress
was not completed.

(cherry picked from commit c846f8b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants