diff --git a/routed.cpp b/routed.cpp index bdf30c652..b4a1cf74b 100644 --- a/routed.cpp +++ b/routed.cpp @@ -23,8 +23,9 @@ or see http://www.gnu.org/licenses/agpl.txt. #include #include -#include #include +#include +#include #include "Server/DataStructures/QueryObjectsStorage.h" #include "Server/ServerConfiguration.h" @@ -138,7 +139,11 @@ int main (int argc, char * argv[0]) { std::cout << "[server] initiating shutdown" << std::endl; s->Stop(); std::cout << "[server] stopping threads" << std::endl; - t.join(); + + if(!t.timed_join(boost::posix_time::seconds(2))) { +// INFO("Threads did not finish within 2 seconds. Hard abort!"); + } + std::cout << "[server] freeing objects" << std::endl; delete s; delete objects;