carb::profiler::ProfiledMutex¶
Defined in carb/profiler/Profile.h
Inheritance Relationships¶
Derived Type¶
public carb::profiler::ProfiledSharedMutex< Mutex >
(carb::profiler::ProfiledSharedMutex)
-
template<class
Mutex
>
classcarb::profiler
::
ProfiledMutex
¶ Wrapper to add automatic profiling to a mutex.
Subclassed by carb::profiler::ProfiledSharedMutex< Mutex >
Public Functions
-
inline
ProfiledMutex
(const uint64_t profileMask, const char *name)¶ Constructor.
- Parameters
profileMask – The mask used to determine if events from this mutex are captured.
name – The name of the mutex
-
inline
ProfiledMutex
(const carb::profiler::Channel &channel, const char *name)¶ Constructor.
- Parameters
channel – The profiling channel used to determine if events from this mutex are captured.
name – The name of the mutex
-
inline
~ProfiledMutex
()¶ Destructor.
-
inline void
lock
()¶ Locks the underlying mutex and reports the event to the profiler.
-
inline bool
try_lock
()¶ Attempts a lock on the underlying mutex and reports the event to the profiler if successful.
- Returns
true
if successfully locked;false
otherwise.
-
inline void
unlock
()¶ Unlocks the underlying mutex and reports the event to the profiler.
Protected Functions
-
inline
ProfiledMutex
(const uint64_t profileMask, bool isSharedMutex, const char *name)¶ Protected Constructor.
- Parameters
profileMask – The mask used to determine if events from this mutex are captured.
isSharedMutex – A boolean representing whether
*this
represents a shared mutex.name – The name of the mutex
-
inline
ProfiledMutex
(const carb::profiler::Channel &channel, bool isSharedMutex, const char *name)¶ Protected Constructor.
- Parameters
channel – The channel used to determine if events from this mutex are captured.
isSharedMutex – A boolean representing whether
*this
represents a shared mutex.name – The name of the mutex
Protected Attributes
-
LockableId
m_lockableId
¶ The lockable ID as returned by carb::profiler::IProfiler::createLockable()
-
inline