std::thread::swap (3) Linux Manual Page
std::thread::swap – std::thread::swap Synopsis void swap(thread &other) noexcept; (since C++ 11) Exchanges the underlying handles of two thread objects. Parameters other – the thread to swap with Return value (none) Example // Run this code #include <iostream> #include <thread> #include <chrono> void foo() { std::this_thread::sleep_for(std::chrono::seconds(1)); } void bar() { std::this_thread::sleep_for(std::chrono::seconds(1)); } int main() { std::thread…
