user16850544
user16850544

Reputation:

std::scoped_lock - vector of mutexes?

How can I apply a std::scoped_lock on a std::vector<std::mutex>? I've tried:

std::vector<std::mutex> mutexes;

std::scoped_lock lock{ mutexes };    // doesn't work
std::scoped_lock lock{ ...mutexes }; // doesn't work

Upvotes: 2

Views: 770

Answers (1)

user16850544
user16850544

Reputation:

A global mutex shared between the output function and sources was the best solution.

Upvotes: 2

Related Questions