As stated in http://en.cppreference.com/w/cpp/error/terminate there are many reasons to call terminate. I can imagine case where just almost in the same time some of these reasons happen in two threads.
Q1 Can the terminate function set by std::set_terminate
be called twice or more at the same time, by the same time I mean second call begins before first has ended.
Thread1 Thread2
| |
_ |
t |
e |
r |
m |
i _
n t
a e
t r
e m
- ?
Q2 If Q1==YES, then what happens if first terminate ended. I guess if it ended with std::abort, then program ends, but what happens if user provided terminate does not abort program?
Q3 Is the terminate function set by std::set_terminate
called in context of the thread which caused this terminate call?