29 Mar
2008
29 Mar
'08
5:02 a.m.
Oops, scoped_lock in Thread 2 needs a name.
boost::mutex Mutex; boost::condition Condition; bool Signalled;
void Thread1() { MyCode::CreateThread2(); boost::mutex::scoped_lock lock(Mutex); Signalled = false; while (!Signalled) Condition.timed_wait(lock, make500msdelay()); } // Thread1
void Thread2() { mutex::scoped_lock lockMutex); Signalled = true; Condition.notify_all(); } // Thread2