Namespace for mutex. More...
Functions | |
template<int num_banks> | |
std::unique_lock< std::mutex > | mutex_lock (const std::size_t index) |
A utility function that returns a mutex lock allocated as a static object. This is an experimental implementation. Example: { // Mutex region const int bank_index = hash(key) % num_banks; auto guard = metall::utility::mutex::mutex_lock<num_banks>(bank_index); // do some mutex work }. More... | |
Namespace for mutex.
|
inline |
A utility function that returns a mutex lock allocated as a static object. This is an experimental implementation. Example: { // Mutex region const int bank_index = hash(key) % num_banks; auto guard = metall::utility::mutex::mutex_lock<num_banks>(bank_index); // do some mutex work }.