I have a pretty large application that dynamically loads shared objects and executes code in the shared object. As a precaution, I put a try/catch around almost everything in main
. I created a catch for 3 things: myException
(an in house exception), std::exception
, and ...
(catch all exceptions).
As part of the shared objects execution, many pthreads
are created. When a thread throws an exception, it is not caught by main
. Is this the standard behavior? How can I catch all exceptions, no matter what thread they are thrown from?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…