Reputation:
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
Reputation:
A global mutex shared between the output function and sources was the best solution.
Upvotes: 2