Ticket #13212: condition_variable_test.cpp

File condition_variable_test.cpp, 336 bytes (added by henri.hakonen@…, 5 years ago)

Test program

Line 
1
2#include <boost/thread/thread.hpp>
3
4boost::condition_variable x;
5
6void Wait();
7
8int main()
9{
10 boost::thread t = boost::thread(Wait);
11 while(true)
12 x.notify_one();
13 return 0;
14}
15
16void Wait()
17{
18 boost::mutex m;
19 boost::unique_lock<boost::mutex> lock(m);
20 while(true)
21 x.wait(lock);
22}