Boost logo

Boost Users :

Subject: Re: [Boost-users] issues when using boost.bind from boost.thread
From: Igor R (boost.lists_at_[hidden])
Date: 2011-03-23 05:17:14


> boost::thread* t = new boost::thread(boost::bind(&boost::asio::io_service::run, &io));
>
> I’m getting the following exception when running this code.
>
> Unhandled exception at 0x7c812afb in MDRLite.exe: Microsoft C++ exception:
> boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error>

The above line of code itself is correct, but it starts a thread,
which dispatches asio handlers. So probably you try to do something
bad inside on of the handlers. Besides, it's important to ensure that
"io" object outlives the thread.
Use exception object member functions to see what it's about.


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