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-11 02:38:00


> it worked! Thank you so much Igor.
> I changed it this way:
> int main(int argc, char* argv[])
> {
>    boost::asio::io_service::work work(io_service);
>    boost::thread thrd_io(boost::bind(&boost::asio::io_service::run,
> &io_service));
>    boost::thread workerThread(workerFunc);
> ...
> }
>
> Can I ask why we needed io_service::work? in windows, it did not require it.

It's not a matter of platform, it's just a timing. You had a race
condition, which produced different results under different
circumstances.


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