La condition non avrebbe bisogno di avere una mutex acquisita ?
Codice:
boost::mutex sleepMutex;
boost::unique_lock<boost::mutex> sleepLock( sleepMutex );
while(working)
{
sleepLock.lock();
if( sleeping )
sleepCondition.wait( sleepLock );
sleepLock.unlock();
update();
this_thread::yield();
}
PS: non conosco libboost, ma vado per analogia con pthread