
12 Feb
2004
12 Feb
'04
1:57 p.m.
There's nothing wrong with your runnable class, but with your use of thread::join(). Boost::threads start as soon as they are constructed, join() means: wait until they are finished. In your test code, it doesn't make sense to join() your threads before you Stop() them. Probably the next is what you meant: Threading::boost_thread_starter starter3((Threading::Runnable *)&writer2); boost::thread* _writer_thread2 = new boost::thread(starter3); // pause for 5 secs boost::xtime xt; boost::xtime_get(&xt, boost::TIME_UTC); xt.sec += 5; boost::thread::sleep(xt); writer2.Stop(); _writer_thread2->join(); Cya, Geert.
7681
Age (days ago)
7681
Last active (days ago)
0 comments
1 participants
participants (1)
-
Geert Pante