0

When should std::scoped_lock be used over std::shared_lock?
I don't think I understand the use of std::scoped_lock.

Or, is std::scoped_lock just a variant of std::unique_lock for holding multiple mutexes?
Ref: "std::lock_guard or std::scoped_lock?"

Holt
  • 36,600
  • 7
  • 92
  • 139
Supreeto
  • 198
  • 9
  • Did you read https://en.cppreference.com/w/cpp/thread ? What part of their description did you not understand? – Passer By Jan 06 '23 at 10:24
  • 2
    Its completelly different things. `std::shared_lock` is used with one shared mutex and `std::scoped_lock` is used with multiple usual mtexes, – sklott Jan 06 '23 at 10:50

0 Answers0