std::scoped_lock or std::unique_lock or std::lock_guard?
The two objects are for different purposes. scoped_lock is for the simple case of wanting to lock some number of mutex objects in a deadlock-free way. Locking a single mutex is just a special case of locking multiple ones. The object is completely immobile, and it’s very simple. unique_lock provides a number of features, few … Read more