summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/vmcircbuf_prefs.cc
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-06-21 15:35:30 -0400
committerTom Rondeau <trondeau@vt.edu>2013-06-21 15:35:30 -0400
commit5653dcfb4f3a836523921e014d2aa50014514e58 (patch)
treebdbe789c59548acf491fe49e490ac188e8aa4276 /gnuradio-runtime/lib/vmcircbuf_prefs.cc
parentad1d52fd9911114ad8c9748e808b55de4e16232b (diff)
runtime: fixed checks on vmcircbuf file and mutex locking for creation and usage of vmcrcbuf classes.
Diffstat (limited to 'gnuradio-runtime/lib/vmcircbuf_prefs.cc')
-rw-r--r--gnuradio-runtime/lib/vmcircbuf_prefs.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/vmcircbuf_prefs.cc b/gnuradio-runtime/lib/vmcircbuf_prefs.cc
index 1fa6350385..258605c6be 100644
--- a/gnuradio-runtime/lib/vmcircbuf_prefs.cc
+++ b/gnuradio-runtime/lib/vmcircbuf_prefs.cc
@@ -25,6 +25,7 @@
#endif
#include "vmcircbuf_prefs.h"
+#include "vmcircbuf.h"
#include <gnuradio/sys_paths.h>
#include <stdio.h>
#include <stdlib.h>
@@ -69,6 +70,8 @@ namespace gr {
{
static char buf[1024];
+ gr::thread::scoped_lock guard(s_vm_mutex);
+
FILE *fp = fopen(pathname (key), "r");
if(fp == 0) {
perror(pathname (key));
@@ -91,6 +94,8 @@ namespace gr {
void
vmcircbuf_prefs::set(const char *key, const char *value)
{
+ gr::thread::scoped_lock guard(s_vm_mutex);
+
ensure_dir_path();
FILE *fp = fopen(pathname(key), "w");