Interprocess.h 425 B

12345678910111213141516171819202122
  1. #include <boost/interprocess/sync/interprocess_mutex.hpp>
  2. #include <boost/interprocess/sync/interprocess_condition.hpp>
  3. struct ServerReady
  4. {
  5. bool ready;
  6. boost::interprocess::interprocess_mutex mutex;
  7. boost::interprocess::interprocess_condition cond;
  8. ServerReady()
  9. {
  10. ready = false;
  11. }
  12. void setToTrueAndNotify()
  13. {
  14. mutex.lock();
  15. ready = true;
  16. mutex.unlock();
  17. cond.notify_all();
  18. }
  19. };