diff options
Diffstat (limited to 'gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc')
-rw-r--r-- | gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc b/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc index 7b461bc26b..919986c608 100644 --- a/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc +++ b/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc @@ -49,6 +49,8 @@ namespace gr { fprintf(stderr, "gr::vmcircbuf_mmap_shm_open: mmap or shm_open is not available\n"); throw std::runtime_error("gr::vmcircbuf_mmap_shm_open"); #else + gr::thread::scoped_lock guard(s_vm_mutex); + static int s_seg_counter = 0; if(size <= 0 || (size % gr::pagesize ()) != 0) { @@ -162,6 +164,8 @@ namespace gr { vmcircbuf_mmap_shm_open::~vmcircbuf_mmap_shm_open() { #if defined(HAVE_MMAP) + gr::thread::scoped_lock guard(s_vm_mutex); + if(munmap (d_base, 2 * d_size) == -1) { perror("gr::vmcircbuf_mmap_shm_open: munmap (2)"); } |