7 #include <boost/interprocess/managed_shared_memory.hpp>
17 std::string mapFileHash{
std::to_string(std::hash<std::string>{}(mapFileName_))};
18 std::string instanceIdHash{
std::to_string(std::hash<std::string>{}(instanceId_))};
19 std::string userHash{
std::to_string(std::hash<std::string>{}(userName))};
21 return "ChimeraTK_SharedDummy_" + instanceIdHash +
"_" + mapFileHash +
"_" + userHash;
28 boost::interprocess::managed_shared_memory shm{boost::interprocess::open_only, shmName.c_str()};
29 result = shm.check_sanity();
31 catch(
const std::exception& ex) {
45 fd = open(dmapFile, O_RDONLY);
47 std::cout <<
"Cannot open file '" << dmapFile <<
"' for locking." << std::endl;
52 int res = flock(
fd, LOCK_EX);
54 std::cout <<
"Cannot acquire lock on file '" << dmapFile <<
"'." << std::endl;