diff options
author | Josh Blum | 2013-07-14 12:41:59 -0700 |
---|---|---|
committer | Josh Blum | 2013-07-14 12:41:59 -0700 |
commit | 57313b409386d676da2f47c7d317797af114f374 (patch) | |
tree | f96e2d2d3983289e5a703d1e899365bdec284299 /lib | |
parent | 9f1d8e892035a2e26cb2d06407722c0a7773e997 (diff) | |
download | sandhi-57313b409386d676da2f47c7d317797af114f374.tar.gz sandhi-57313b409386d676da2f47c7d317797af114f374.tar.bz2 sandhi-57313b409386d676da2f47c7d317797af114f374.zip |
gras: circ buff mutex for dealloc as well
Diffstat (limited to 'lib')
-rw-r--r-- | lib/circular_buffer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/circular_buffer.cpp b/lib/circular_buffer.cpp index a193ad1..30be0ac 100644 --- a/lib/circular_buffer.cpp +++ b/lib/circular_buffer.cpp @@ -106,8 +106,6 @@ CircularBuffer::CircularBuffer(const size_t num_bytes): buff_addr(NULL), actual_length(round_up_to_ipc_page(num_bytes)) { - boost::mutex::scoped_lock lock(alloc_mutex); - //////////////////////////////////////////////////////////////// // Step 0) Find an address that can be mapped across 2x length: //////////////////////////////////////////////////////////////// @@ -175,11 +173,13 @@ CircularBuffer::CircularBuffer(const size_t num_bytes): static void circular_buffer_delete(SBuffer &buff, CircularBuffer *circ_buff) { + boost::mutex::scoped_lock lock(alloc_mutex); delete circ_buff; } SBuffer make_circular_buffer(const size_t num_bytes) { + boost::mutex::scoped_lock lock(alloc_mutex); CircularBuffer *circ_buff = NULL; size_t trial_count = 0; while (circ_buff == NULL) |