| 69 | } |
| 70 | |
| 71 | void springClean() |
| 72 | { |
| 73 | osrm::util::Log() << "Releasing all locks"; |
| 74 | osrm::util::Log() << "ATTENTION! BE CAREFUL!"; |
| 75 | osrm::util::Log() << "----------------------"; |
| 76 | osrm::util::Log() << "This tool may put osrm-routed into an undefined state!"; |
| 77 | osrm::util::Log() << "Type 'Y' to acknowledge that you know what your are doing."; |
| 78 | osrm::util::Log() << "\n\nDo you want to purge all shared memory allocated " |
| 79 | << "by osrm-datastore? [type 'Y' to confirm]"; |
| 80 | |
| 81 | const auto letter = getchar(); |
| 82 | if (letter != 'Y') |
| 83 | { |
| 84 | osrm::util::Log() << "aborted."; |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | for (auto key : util::irange<storage::SharedRegionRegister::RegionID>( |
| 89 | 0, storage::SharedRegionRegister::MAX_SHM_KEYS)) |
| 90 | { |
| 91 | deleteRegion(key); |
| 92 | } |
| 93 | removeLocks(); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // generate boost::program_options object for the routing part |
| 98 | bool generateDataStoreOptions(const int argc, |
no test coverage detected