...

/

std::scoped_lock

std::scoped_lock

Let's look at the how C++17 allows locking a variadic number of mutexes simultaneously.

Previous functionality: lock_guard

With C++11 and C++14 we got the threading library and many support functionalities.

For example, with std::lock_guard you can take ownership of a mutex and lock it in RAII style:

 ...