Boost logo

Boost Users :

From: Torsten (Torsten.Goroll_at_[hidden])
Date: 2006-11-06 08:17:42


Hi,

im trying to initiate a sub thread for checking some variables during the main
program is running:

...do sth...

boost::thread checkT(&check);
checkT.join();

...do sth...

As I understand boost::threads the second "do sth" should be performed during
the thread is running. Well, it doesn't seem so. After experimenting some time
it came up that starting two threads like that:

boost::thread checkT(&check);
boost::thread stopCheckT(&stopCheck);
checkT.join();
scheckT.join();

does work, but that:

boost::thread checkT(&check);
checkT.join();
boost::thread stopCheckT(&stopCheck);
scheckT.join();

does not. I really don't understand why. Either .join() stops executing the code
(so the scheckT.join() in the first example shouldn't be called) or it doesn't
(than the second scheckT should be called too).

Where am I wrong? Has anybody an idea?

Torsten


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