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 pr
17.6.4.7p4 says:
Calling the
set_*andget_*functions shall not incur a data race. A call to any of theset_*functions shall synchronize with subsequent calls to the sameset_*function and to the correspondingget_*function.
This strongly implies that the set_* and get_* functions are operating on the same global state even when called from different threads. All the paragraphs under 18.8.3 discuss "the current handler function", with no other mention of threading; this indicates that the handler function is a property of the program as a whole; similarly, 17.6.4.7 has:
2 - A C++ program may install different handler functions during execution [...]
3 - A C++ program can get a pointer to the current handler function by calling the following functions [...]
These paragraphs discuss the current handler function in the context of a program, indicating that it is program-scope and not thread-local.