2013-10-17 12:11:53 -04:00
|
|
|
#include <boost/interprocess/sync/interprocess_mutex.hpp>
|
|
|
|
#include <boost/interprocess/sync/interprocess_condition.hpp>
|
|
|
|
|
|
|
|
struct SharedBarriers {
|
|
|
|
|
|
|
|
SharedBarriers () : update_ongoing(false), number_of_queries(0) { }
|
|
|
|
|
|
|
|
// Mutex to protect access to the boolean variable
|
2013-10-21 13:07:49 -04:00
|
|
|
boost::interprocess::interprocess_mutex pending_update_mutex;
|
|
|
|
boost::interprocess::interprocess_mutex update_mutex;
|
|
|
|
boost::interprocess::interprocess_mutex query_mutex;
|
2013-10-17 12:11:53 -04:00
|
|
|
|
|
|
|
// Condition that no update is running
|
2013-10-21 13:07:49 -04:00
|
|
|
boost::interprocess::interprocess_condition no_running_queries_condition;
|
2013-10-17 12:11:53 -04:00
|
|
|
|
2013-10-18 15:58:07 -04:00
|
|
|
// Is there an ongoing update?
|
2013-10-17 12:11:53 -04:00
|
|
|
bool update_ongoing;
|
2013-10-18 15:58:07 -04:00
|
|
|
// Is there any query?
|
2013-10-17 12:11:53 -04:00
|
|
|
int number_of_queries;
|
|
|
|
};
|