log err instead of throwing when no shmem regions found

This commit is contained in:
karenzshea
2018-04-12 15:53:43 +02:00
committed by Patrick Niklaus
parent 16abee1022
commit 730d2b5ef2
2 changed files with 17 additions and 3 deletions
+11
View File
@@ -117,6 +117,17 @@ 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