diff --git a/DataStructures/SharedMemoryFactory.h b/DataStructures/SharedMemoryFactory.h index f9ffcc73a..3bb9cc8b1 100644 --- a/DataStructures/SharedMemoryFactory.h +++ b/DataStructures/SharedMemoryFactory.h @@ -38,6 +38,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#ifdef __linux__ +#include +#include +#endif + #include #include @@ -97,6 +102,7 @@ public: boost::interprocess::open_only, key ); + region = boost::interprocess::mapped_region ( shm, ( @@ -115,6 +121,10 @@ public: key, size ); + +#ifdef __linux__ + shmctl(shm.get_shmid(), SHM_LOCK, 0); +#endif region = boost::interprocess::mapped_region ( shm, boost::interprocess::read_write