summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/vmcircbuf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/lib/vmcircbuf.cc')
-rw-r--r--gnuradio-runtime/lib/vmcircbuf.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/vmcircbuf.cc b/gnuradio-runtime/lib/vmcircbuf.cc
index 0fccb3d914..e4e1590205 100644
--- a/gnuradio-runtime/lib/vmcircbuf.cc
+++ b/gnuradio-runtime/lib/vmcircbuf.cc
@@ -40,6 +40,8 @@
#include "vmcircbuf_mmap_shm_open.h"
#include "vmcircbuf_mmap_tmpfile.h"
+gr::thread::mutex s_vm_mutex;
+
namespace gr {
static const char *FACTORY_PREF_KEY = "vmcircbuf_default_factory";
@@ -64,6 +66,8 @@ namespace gr {
bool verbose = false;
+ gr::thread::scoped_lock guard(s_vm_mutex);
+
std::vector<gr::vmcircbuf_factory *> all = all_factories ();
const char *name = gr::vmcircbuf_prefs::get(FACTORY_PREF_KEY);
@@ -288,6 +292,8 @@ namespace gr {
{
bool ok = false;
+ gr::thread::scoped_lock guard(s_vm_mutex);
+
std::vector<vmcircbuf_factory *> all = all_factories();
for(unsigned int i = 0; i < all.size (); i++)