diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-07-28 11:33:16 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-07-28 11:33:16 -0400 |
commit | 643ca3669b74c63578c64df7b7e1819ef0d6b9b7 (patch) | |
tree | 3f78b2b849a046b8c842e2755c811544b4c921d6 /gr-blocks/lib/file_meta_source_impl.cc | |
parent | 26073292d8059f4efb2c898581060df55c1fcd3f (diff) |
blocks: correcting use of mutexes in file_meta_sink.
the gr::block class has a d_setlock mutex that's appropriate for this use instead of creating another for the child class.
Diffstat (limited to 'gr-blocks/lib/file_meta_source_impl.cc')
-rw-r--r-- | gr-blocks/lib/file_meta_source_impl.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gr-blocks/lib/file_meta_source_impl.cc b/gr-blocks/lib/file_meta_source_impl.cc index 58be9ece7e..5686945700 100644 --- a/gr-blocks/lib/file_meta_source_impl.cc +++ b/gr-blocks/lib/file_meta_source_impl.cc @@ -297,7 +297,7 @@ namespace gr { bool file_meta_source_impl::_open(FILE **fp, const char *filename) { - gr::thread::scoped_lock guard(d_mutex); // hold mutex for duration of this function + gr::thread::scoped_lock guard(d_setlock); // hold mutex for duration of this function bool ret = true; int fd; @@ -326,7 +326,7 @@ namespace gr { void file_meta_source_impl::close() { - gr::thread::scoped_lock guard(d_mutex); // hold mutex for duration of this function + gr::thread::scoped_lock guard(d_setlock); // hold mutex for duration of this function if(d_state == STATE_DETACHED) { if(d_new_hdr_fp) { fclose(d_new_hdr_fp); @@ -345,7 +345,7 @@ namespace gr { file_meta_source_impl::do_update() { if(d_updated) { - gr::thread::scoped_lock guard(d_mutex); // hold mutex for duration of this block + gr::thread::scoped_lock guard(d_setlock); // hold mutex for duration of this block if(d_state == STATE_DETACHED) { if(d_hdr_fp) fclose(d_hdr_fp); @@ -403,7 +403,7 @@ namespace gr { d_tags.pop_back(); } - gr::thread::scoped_lock lock(d_mutex); // hold for the rest of this function + gr::thread::scoped_lock lock(d_setlock); // hold for the rest of this function while(size) { i = fread(out, d_itemsize, size, d_fp); |