From 5f80c33b24f684893a5c78adcb658c78077387a6 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 30 Oct 2013 17:05:49 +0100 Subject: [PATCH] lock update when queries are still running --- datastore.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/datastore.cpp b/datastore.cpp index c9234b433..3a7c8b532 100644 --- a/datastore.cpp +++ b/datastore.cpp @@ -374,6 +374,15 @@ int main( const int argc, const char * argv[] ) { data_type_memory->Ptr() ); + boost::interprocess::scoped_lock< + boost::interprocess::named_mutex + > query_lock(barrier.query_mutex); + + // notify all processes that were waiting for this condition + if (0 < barrier.number_of_queries) { + barrier.no_running_queries_condition.wait(query_lock); + } + data_timestamp_ptr->layout = LAYOUT; data_timestamp_ptr->data = DATA; data_timestamp_ptr->timestamp +=1;