
"James Talbut" <James.Talbut@omg3d.com> writes:
By calling std::terminate in the catch handler we lose the JIT debugger - and thus information about what the exception is that we haven't caught. Without the catch the process is still going to be killed, so what's the benefit of having that?
It's not specified in either the pthreads docs or the Windows docs what happens if the thread function leaks an exception, since these are C APIs. Depending on the compiler/platform a leaked exception in a thread may either just terminate the thread, may terminate the whole process, or may cause undefined behaviour. I know that some platforms don't support exceptions in C stack frames, and will throw a wobbly. By catching the exception and calling terminate(), the thread library makes it explicit that this is an error. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL