deciding which memory subsystem to use depending on server.ini

This commit is contained in:
Dennis Luxen 2013-10-01 16:48:40 +02:00
parent 252113c838
commit 59cf1a4937

View File

@ -127,12 +127,14 @@ int main (int argc, const char * argv[]) {
pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask); pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask);
#endif #endif
OSRM routing_machine(server_paths); bool use_shared_memory = false;
OSRM routing_machine(server_paths, use_shared_memory);
Server * s = ServerFactory::CreateServer( Server * s = ServerFactory::CreateServer(
ip_address, ip_address,
ip_port, ip_port,
requested_num_threads requested_num_threads
); );
s->GetRequestHandlerPtr().RegisterRoutingMachine(&routing_machine); s->GetRequestHandlerPtr().RegisterRoutingMachine(&routing_machine);
boost::thread t(boost::bind(&Server::Run, s)); boost::thread t(boost::bind(&Server::Run, s));
@ -159,7 +161,8 @@ int main (int argc, const char * argv[]) {
std::cout << "[server] stopping threads" << std::endl; std::cout << "[server] stopping threads" << std::endl;
if(!t.timed_join(boost::posix_time::seconds(2))) { if(!t.timed_join(boost::posix_time::seconds(2))) {
SimpleLogger().Write(logDEBUG) << "Threads did not finish within 2 seconds. Hard abort!"; SimpleLogger().Write(logDEBUG) <<
"Threads did not finish within 2 seconds. Hard abort!";
} }
std::cout << "[server] freeing objects" << std::endl; std::cout << "[server] freeing objects" << std::endl;