Can you combine std::recursive_mutex with std::condition_variable?

You can, if you use std::condition_variable_any, which allows for any type of object that supports the Lockable concept.

However, in the case of recursive mutex, you do have to ensure that the given thread has only locked the recursive mutex once, since the condition variable only will use the unlock method on the unique_lock once during the wait.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)