Skip to content

Commit

Permalink
fix: if there's nothing to judge, stop immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
alphagocc committed Oct 24, 2021
1 parent 502c48c commit d3b4a50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion makespec/BUILDVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
186
187
3 changes: 2 additions & 1 deletion src/core/contest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ void Contest::judge(const QVector<std::pair<Contestant *, int>> &judgingTasks) {
}

auto eventLoop = new QEventLoop();
connect(controller, &JudgingController::judgeFinished, eventLoop, &QEventLoop::quit);
connect(controller, &JudgingController::judgeFinished, eventLoop, &QEventLoop::quit,
Qt::QueuedConnection);

controller->start();

Expand Down
4 changes: 4 additions & 0 deletions src/core/judgingcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ void JudgingController::taskFinished() {
}
}
void JudgingController::start() {
if (queuingTasks.size() == 0) {
emit judgeFinished();
return;
}
isJudging = 1;
while (! queuingTasks.empty() && runningTasks.size() < maxThreads) {
assign();
Expand Down

0 comments on commit d3b4a50

Please sign in to comment.