void run();
void stop();
+ boost::shared_ptr<boost::thread> vs_thread_ptr;
+
void connection_active(const boost::asio::ip::tcp::endpoint &);
void connection_inactive(const boost::asio::ip::tcp::endpoint &);
void release_session(const tcp_session *session_ptr);
try {
// create thread and run
- vs_threads.create_thread(boost::bind(&virtual_service::run, vsptr));
+ (*vsptr).vs_thread_ptr = boost::shared_ptr<boost::thread>(vs_threads.create_thread(boost::bind(&virtual_service::run, vsptr)));
} catch (...) {
std::stringstream buf;
if (vslist.end() != vsitr) {
// vs stop
(*vsitr)->stop();
+ (*vsitr)->vs_thread_ptr->join();
+ vs_threads.remove_thread((*vsitr)->vs_thread_ptr.get());
// vs finalize
(*vsitr)->finalize(err);