Should set_terminate/get_terminate set a different terminate exception processor for several threads in C++ 2011 or C++ 2003?
E.g. if I have program and sets terminate handler to func_1; then I start 3 threads. What are terminate handlers in new threads? What if in every thread I will set terminate handler to func_2 in first thread, func_3 in second thread and so on.
N3242 (C++ 2011 draft) says nothing about it in [handler.functions] or in [support.exception]/[exception.terminate]
PS: You may answer for C++2011 or for C++2003 of for any popular implementation of these standards
PPS: There is FCD Comment for this... C++ FCD Comment Status Rev. 5 N3249 (2011):
GB 71 18.6.2.4 / 18.8.2.2 / 18.8.3.2
The thread safety of
std::set_new_handler(),std::set_unexpected(),std::set_terminate(), is unspecified making the the functions impossible to use in a thread safe manner.The thread safety guarantees for the functions must be specified and new interfaces should be provided to make it possible to query and install handlers in a thread safe way.
LWG 1365 ACCEPTED with MODIFICATIONS
See paper N3189