So say we have pseudocode like:
super_local_thread()
{
try{
throw err;
}catch(err)
{
throw err2;
}
and we had launched that thread with boost.
We want to chath its error with another thread. How to do such thing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C++11 specifies a
current_exceptionfunction (in the standard, section 18.8 Exception Handling) to allow you to do exactly that.Here’s an MSDN article on transporting exceptions between threads that makes use of this function.
Since you’re using Boost, here’s the Boost documentation for
current_exceptionand Boost article on transporting exceptions between threads .