summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/vmcircbuf.h
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-06-14 18:15:50 -0400
committerTom Rondeau <trondeau@vt.edu>2013-06-14 18:15:50 -0400
commit234b0f02a954928c54485c38ef37126ba5197597 (patch)
treef5e8050e9463d80e81e48addb9da873a3c3a20dd /gnuradio-runtime/lib/vmcircbuf.h
parent2fb6d0a21a133207e9b93545c4fe3754d22cdfc7 (diff)
runtime: 2 threading issues with the shared memory system.
1. Making a global mutex for the VM circular buffers to use and lock for multiple top_blocks to handle accessing the memory. 2. Catch the bad_alloc exception once and retry. After 1., this rarely happens unless the thread count gets large (> 20 as an estimate).
Diffstat (limited to 'gnuradio-runtime/lib/vmcircbuf.h')
-rw-r--r--gnuradio-runtime/lib/vmcircbuf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/vmcircbuf.h b/gnuradio-runtime/lib/vmcircbuf.h
index c3ddfe0043..f9ed045168 100644
--- a/gnuradio-runtime/lib/vmcircbuf.h
+++ b/gnuradio-runtime/lib/vmcircbuf.h
@@ -24,8 +24,11 @@
#define GR_VMCIRCBUF_H
#include <gnuradio/api.h>
+#include <gnuradio/thread/thread.h>
#include <vector>
+extern gr::thread::mutex s_vm_mutex;
+
namespace gr {
/*!