Boost logo

Boost Users :

Subject: Re: [Boost-users] The callback of the timer inside a thread is not called
From: Igor R (boost.lists_at_[hidden])
Date: 2012-05-10 15:03:56


> int main(int argc, char* argv[])
> {
>    boost::thread thrd_io(boost::bind(&boost::asio::io_service::run, &io_service));

The above will probably exit immediately, as it doesn't have work.

>    boost::thread workerThread(workerFunc);
>  while ( true ) {
>        try {
>            io_service.run();

This one might also exit before another thread gives any work to the io_service.

In short, try to create io_service::work before you call
io_service::run() and see if it helps.


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