timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
locking.hpp File Reference
#include "timemory/api.hpp"
#include <array>
#include <mutex>
+ Include dependency graph for locking.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  tim
 

Typedefs

using tim::mutex_t = std::recursive_mutex
 Recursive mutex is used for convenience since the performance penalty vs. a regular mutex is not really an issue since there are not many locks in general. More...
 
using tim::auto_lock_t = std::unique_lock< mutex_t >
 Unique lock type around mutex_t. More...
 

Functions

template<typename Tp , typename ApiT = TIMEMORY_API, size_t N = 4, typename MutexT = mutex_t>
MutexT & tim::type_mutex (uint64_t _n=0)
 A simple way to get a mutex for a class or common behavior, e.g. type_mutex<decltype(std::cout)>() provides a mutex for synchronizing output streams. Recommend using in conjunction with auto-lock: tim::auto_lock_t _lk{ type_mutex<Foo>() }. More...