loolwsd/LOOLWSD.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
New commits: commit e1d5f991e8a858f697cf1b3fd2e995262916d04d Author: Tor Lillqvist <t...@collabora.com> Date: Tue Mar 22 17:52:50 2016 +0200 Get rid of weird looping behaviour When no child process has died, I don't see the point in calling waitpid() eleven times in quick succession (with WNOHANG), doing nothing else, and then sleeping for a bit. Let's call waitpid() just once, and sleep only if the return value indicates that no child process has died. diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 68edf47..2d74b8a 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -1319,7 +1319,6 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/) } int status = 0; - unsigned timeoutCounter = 0; while (!TerminationFlag && !LOOLWSD::DoTest) { const pid_t pid = waitpid(brokerPid, &status, WUNTRACED | WNOHANG); @@ -1382,10 +1381,8 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/) continue; } } - - if (timeoutCounter++ == INTERVAL_PROBES) + else // pid == 0, no children have died { - timeoutCounter = 0; sleep(MAINTENANCE_INTERVAL*2); } } commit 913ed1114a0807ce670e96a37549585a622591c4 Author: Tor Lillqvist <t...@collabora.com> Date: Tue Mar 22 17:25:35 2016 +0200 Sort #include and 'using' lines diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index a5f1dd1..68edf47 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -58,6 +58,12 @@ DEALINGS IN THE SOFTWARE. #include <mutex> #include <sstream> +#include <Poco/DOM/AutoPtr.h> +#include <Poco/DOM/DOMParser.h> +#include <Poco/DOM/DOMWriter.h> +#include <Poco/DOM/Document.h> +#include <Poco/DOM/Element.h> +#include <Poco/DOM/NodeList.h> #include <Poco/Exception.h> #include <Poco/File.h> #include <Poco/FileStream.h> @@ -81,13 +87,14 @@ DEALINGS IN THE SOFTWARE. #include <Poco/Net/NetException.h> #include <Poco/Net/PartHandler.h> #include <Poco/Net/PrivateKeyPassphraseHandler.h> +#include <Poco/Net/SSLManager.h> #include <Poco/Net/SecureServerSocket.h> #include <Poco/Net/ServerSocket.h> #include <Poco/Net/SocketAddress.h> -#include <Poco/Net/SSLManager.h> #include <Poco/Net/WebSocket.h> #include <Poco/Path.h> #include <Poco/Process.h> +#include <Poco/SAX/InputSource.h> #include <Poco/StreamCopier.h> #include <Poco/StringTokenizer.h> #include <Poco/TemporaryFile.h> @@ -99,13 +106,6 @@ DEALINGS IN THE SOFTWARE. #include <Poco/Util/OptionException.h> #include <Poco/Util/OptionSet.h> #include <Poco/Util/ServerApplication.h> -#include <Poco/DOM/DOMParser.h> -#include <Poco/DOM/DOMWriter.h> -#include <Poco/SAX/InputSource.h> -#include <Poco/DOM/AutoPtr.h> -#include <Poco/DOM/Document.h> -#include <Poco/DOM/NodeList.h> -#include <Poco/DOM/Element.h> #include "Admin.hpp" #include "Auth.hpp" @@ -164,13 +164,13 @@ using Poco::Util::MissingOptionException; using Poco::Util::Option; using Poco::Util::OptionSet; using Poco::Util::ServerApplication; -using Poco::XML::InputSource; using Poco::XML::AutoPtr; using Poco::XML::DOMParser; using Poco::XML::DOMWriter; +using Poco::XML::Element; +using Poco::XML::InputSource; using Poco::XML::Node; using Poco::XML::NodeList; -using Poco::XML::Element; std::map<std::string, std::shared_ptr<DocumentBroker>> LOOLWSD::DocBrokers; std::mutex LOOLWSD::DocBrokersMutex; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits