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