Skip to content

Commit 416fc72

Browse files
committed
Allow printing arbitrary progress
1 parent db8ad2d commit 416fc72

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/commons/Debug.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,13 @@ class Debug
178178
prevPrintedId = 0;
179179
}
180180

181-
void updateProgress(){
182-
size_t id = __sync_fetch_and_add(&currentPos, 1);
181+
void updateProgress(size_t pos = SIZE_MAX){
182+
size_t id;
183+
if (pos == SIZE_MAX) {
184+
id = __sync_fetch_and_add(&currentPos, 1);
185+
} else {
186+
id = pos;
187+
}
183188
// if no active terminal exists write dots
184189
if(interactive == false){
185190
if(totalEntries==SIZE_MAX) {

0 commit comments

Comments
 (0)