Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| adee18468c | |||
| 9a9abf4c11 | |||
| 331eeca4c1 | |||
| f8d6e4750a |
@@ -117,6 +117,19 @@ template <typename Data> struct SharedMonitor
|
||||
#endif
|
||||
|
||||
static void remove() { bi::shared_memory_object::remove(Data::name); }
|
||||
static bool exists()
|
||||
{
|
||||
try
|
||||
{
|
||||
bi::shared_memory_object shmem_open =
|
||||
bi::shared_memory_object(bi::open_only, Data::name, bi::read_only);
|
||||
}
|
||||
catch (const bi::interprocess_exception &exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
#if USE_BOOST_INTERPROCESS_CONDITION
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "osrm",
|
||||
"version": "5.17.0-rc.3",
|
||||
"version": "5.17.0-rc.4",
|
||||
"private": false,
|
||||
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
||||
"dependencies": {
|
||||
|
||||
+6
-4
@@ -27,12 +27,15 @@ void deleteRegion(const storage::SharedRegionRegister::ShmKey key)
|
||||
|
||||
void listRegions()
|
||||
{
|
||||
|
||||
osrm::util::Log() << "name\tshm key\ttimestamp\tsize";
|
||||
if (!storage::SharedMonitor<storage::SharedRegionRegister>::exists())
|
||||
{
|
||||
return;
|
||||
}
|
||||
storage::SharedMonitor<storage::SharedRegionRegister> monitor;
|
||||
std::vector<std::string> names;
|
||||
const auto &shared_register = monitor.data();
|
||||
shared_register.List(std::back_inserter(names));
|
||||
osrm::util::Log() << "name\tshm key\ttimestamp\tsize";
|
||||
for (const auto &name : names)
|
||||
{
|
||||
auto id = shared_register.Find(name);
|
||||
@@ -105,8 +108,7 @@ bool generateDataStoreOptions(const int argc,
|
||||
boost::program_options::value<bool>(&list_datasets)
|
||||
->default_value(false)
|
||||
->implicit_value(true),
|
||||
"Name of the dataset to load into memory. This allows having multiple datasets in memory "
|
||||
"at the same time.") //
|
||||
"List all OSRM datasets currently in memory") //
|
||||
("only-metric",
|
||||
boost::program_options::value<bool>(&only_metric)
|
||||
->default_value(false)
|
||||
|
||||
Reference in New Issue
Block a user