osrm-backend/Server/DataStructures/SharedBarriers.h

20 lines
628 B
C
Raw Normal View History

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
boost::interprocess::interprocess_mutex update_mutex;
boost::interprocess::interprocess_mutex query_mutex;
// Condition that no update is running
boost::interprocess::interprocess_condition update_finished_condition;
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;
};