3 Jul
2013
3 Jul
'13
6 a.m.
See my comments below.
// dir_monitor thread boost::thread mthread = boost::thread(boost::bind(&boost::asio::io_service::run, boost::ref(io_service)));
// setup work to prevent premature exit shared_ptrboost::asio::io_service::work work(new boost::asio::io_service::work(work_service));
Set "work" *before* running io_service, otherwise io_service::run might already have exited at this point, because it's out of work.
while (true) { io_service.reset();
I'm not sure what this loop is for, but why do you reset io_service? It will stop working. Please, read manual: http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/io_servic...