A class to be used as mixin with actual std::mutex instance inside.
More...
#include <sync_helpers.hpp>
|
template<typename Lambda > |
auto | lock_and_perform (Lambda &&l) const -> decltype(l()) |
| Do actual lock and perform necessary action. More...
|
|
template<typename Lock_Type = std::mutex>
class so_5::details::actual_lock_holder_t< Lock_Type >
A class to be used as mixin with actual std::mutex instance inside.
Usage example:
template< typename Lock_Holder >
{
public :
bool has_live_coop()
{
}
};
using mtsafe_coop_repo_t = coop_repo_t< so_5::details::actual_lock_holder_t >;
- Template Parameters
-
Lock_Type | type of lock to be used for object protection. Will be used with std::lock_guard. |
- Since
- v.5.5.19
◆ lock_and_perform()
template<typename Lock_Type = std::mutex>
template<typename Lambda >
Do actual lock and perform necessary action.
◆ m_lock
template<typename Lock_Type = std::mutex>
Actual lock.
- Note
- This is mutable attibute because locking can be necessary even in const methods of derived classes.
The documentation for this class was generated from the following file: