#include #include #include #include #include #include #include #include "boost/filesystem.hpp" #include "boost/filesystem/operations.hpp" using boost::format; using boost::asio::ip::tcp; using namespace boost::filesystem; using namespace std; using namespace boost::posix_time; struct Tes { int m_nVal; }; boost::asio::io_service m_ioService(5); boost::thread_group m_serviceRun; boost::recursive_mutex m_threadCountMutex; boost::shared_ptr m_ioStrand; boost::shared_ptr m_testTimer; void RunService() { for (;;) { try { cout<<"Run application."< myTes(new Tes); myTes->m_nVal=10; cout<<"Boost shared pointer is wroking : "<m_nVal<expires_from_now(seconds(5)); m_testTimer->async_wait(m_ioStrand->wrap(boost::bind(&TestTimer,_1))); Initialize(2); Join(); return 0; }