It works better to set TerminationFlag
That global flag is checked all over the place, so setting it will actually make the threads eventually finish. (All polling is done with timeout, I think, and then checking TerminationFlag whenever the poll times out.) Sure, it would be much better to use an eventfd and poll that, too, instead of timing out from the polls all the time to check a plain old boolean flag.
This commit is contained in:
parent
26ceda2f15
commit
04f3a9e111
1 changed files with 1 additions and 1 deletions
|
@ -1496,7 +1496,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
|
|||
if (careerSpanSeconds > 0 && time(nullptr) > startTimeSpan + careerSpanSeconds)
|
||||
{
|
||||
Log::info(std::to_string(time(nullptr) - startTimeSpan) + " seconds gone, finishing as requested.");
|
||||
break;
|
||||
TerminationFlag = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue