Skip to content

Commit e551bf8

Browse files
committed
Fixed being infinitely stuck at 100%, and infinite 'cancelling operation' spam
1 parent 9e64fcf commit e551bf8

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

library.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,21 +276,14 @@ extern "C"
276276
}
277277

278278
size_t lastProcessed = 0;
279-
while (true) {
280-
bool allDone = true;
281-
for (auto& t : threads) {
282-
if (t.joinable()) {
283-
allDone = false;
284-
break;
285-
}
286-
}
287-
288-
if (allDone)
289-
break;
290-
279+
bool cancelLogged = false;
280+
while (processedFunctions.load() < totalFuncs) {
291281
if (task->IsCancelled()) {
292282
shouldCancel.store(true);
293-
LogWarn("Cancelling operation...");
283+
if (!cancelLogged) {
284+
LogWarn("Cancelling operation...");
285+
cancelLogged = true;
286+
}
294287
}
295288

296289
size_t currentProcessed = processedFunctions.load();

0 commit comments

Comments
 (0)