mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
23 lines
425 B
C
23 lines
425 B
C
|
#include <boost/interprocess/sync/interprocess_mutex.hpp>
|
||
|
#include <boost/interprocess/sync/interprocess_condition.hpp>
|
||
|
|
||
|
struct ServerReady
|
||
|
{
|
||
|
bool ready;
|
||
|
boost::interprocess::interprocess_mutex mutex;
|
||
|
boost::interprocess::interprocess_condition cond;
|
||
|
|
||
|
ServerReady()
|
||
|
{
|
||
|
ready = false;
|
||
|
}
|
||
|
|
||
|
void setToTrueAndNotify()
|
||
|
{
|
||
|
mutex.lock();
|
||
|
ready = true;
|
||
|
mutex.unlock();
|
||
|
cond.notify_all();
|
||
|
}
|
||
|
};
|