Boost logo

Boost Users :

From: Terry G (tjgolubi_at_[hidden])
Date: 2008-03-29 01:02:58


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
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net