Wrapper for Lockable type mutexes, such as std::mutex and std::recursive_mutex. More...
#include <ai_critsec.h>
Public Types | |
| using | mutex_type = Mutex |
| using | native_handle_type = typename Mutex::native_handle_type |
Public Member Functions | |
| void | lock () |
| bool | try_lock () |
| void | unlock () |
| native_handle_type | native_handle () |
| const mutex_type & | get () const |
| mutex_type & | get () |
Wrapper for Lockable type mutexes, such as std::mutex and std::recursive_mutex.
Use this so that the arnold profiler can keep track of of the time spent blocked waiting to lock. For instance, you can replace the following C++11/14 code:
with:
As a convenience, the AtMutex and AtRecursiveMutex type aliases can be used so that instead one would write:
Note that starting with C++17 this can be further simplified to: