|
Boost Users : |
Subject: Re: [Boost-users] The callback of the timer inside a thread is not called
From: mozdemir (mozdemir76_at_[hidden])
Date: 2012-05-10 17:15:19
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.
Thanks,
mustafa
below is the output after i used it.
$./timer
main: startup
main: after thrd_io
main: after workerThread
Worker: running
Starting synchronous wait
Finished synchronous wait
Starting asynchronous wait
timer is set to expire at '1336684315'
Finished asynchronous wait
handle_timeout
Worker: finished
-- View this message in context: http://boost.2283326.n4.nabble.com/The-callback-of-the-timer-inside-a-thread-is-not-called-tp4623920p4624695.html Sent from the Boost - Users mailing list archive at Nabble.com.
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