#include <mutex>#include <cassert>Go to the source code of this file.
Namespaces | |
| namespace | metall |
| The top level of namespace of Metall. | |
| namespace | metall::utility |
| Namespace for utility items. | |
| namespace | metall::utility::mutex |
| Namespace for mutex. | |
Functions | |
| template<int num_banks> | |
| std::unique_lock< std::mutex > | metall::utility::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 }. | |