mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 00:59:41 +01:00
ParallelLoop: make loop tasks cancellable to avoid hang on Teardown
SimpleParallelTask/LoopRangeTask never overrode Cancellable(), so a ThreadManager::Teardown() racing with an in-flight parallel loop would drop them without ever calling counter_->Count(), leaving anyone blocked in WaitableCounter::Wait() stuck forever. Cancel() now counts down the same as a normal completion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
This commit is contained in:
1 parent
dcf742edb4
commit
973a10473a
2 files changed
+20
No files matched your search
@@ -23,6 +23,16 @@ public:
|
||||
counter_->Count();
|
||||
}
|
||||
|
||||
// Cancellable so a Teardown() racing with an in-flight parallel loop still
|
||||
// counts down the waiter's counter instead of leaving it blocked forever.
|
||||
bool Cancellable() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Cancel() override {
|
||||
counter_->Count();
|
||||
}
|
||||
|
||||
std::function<void(int, int)> loop_;
|
||||
WaitableCounter *counter_;
|
||||
|
||||
|
||||
Reference in new issue
Block a user