C++ Language/Std/Multithreading/ThreadCreation
Appearance
To create a thread in modern C++, instantiate std::thread
, passing it a callable-object for the worker thread's entry point.
To block yourself for an arbitrary amount of time, call std::this_thread::sleep_for()
.
To block yourself until the worker thread has finished its work, call oThread.join()
.