My recent efforts to implement a thread/ mutex manager ended up in an 75% CPU load (4 core), while all four running threads were either in sleep or waiting for a mutex beein
The std::lock() non-member function may cause Live-lock problem or performance degradation, it guarantee only "Never Dead-lock".
If you can determine "Lock order(Lock hierarchy)" of multiple mutexes by design, it's preferable to not use generic std::lock() but lock each mutexes in pre-determinate order.
Refer to Acquiring Multiple Locks Without Deadlock for more detail.