I have two threads running in parallell started from the main thread.
Either thread may fail. If it do so I want to ask the other thread to cancel as well.
In C++ 20 there is std::stop_token and std::stop_source.
I have found several examples where the main thread ask all threads to cancel (deferred cancelation).
However I have not found any examples where either worker thread may deferred cancel all other worker threads.
How is this done?