libhatchet
Loading...
Searching...
No Matches
hxunique_lock Class Reference

#include <hxthread.hpp>

Public Member Functions

 hxunique_lock (hxmutex &mtx_, bool defer_lock_=false)
 ~hxunique_lock (void)
void lock (void)
void unlock (void)
bool owns_lock (void) const
hxmutexmutex (void)

Detailed Description

hxunique_lock - std::unique_lock style RAII-style unique lock for hxmutex.

Locks the mutex on construction and unlocks on destruction.

Constructor & Destructor Documentation

◆ hxunique_lock()

hxunique_lock::hxunique_lock ( hxmutex & mtx_,
bool defer_lock_ = false )
inline

Constructs with an option to defer locking.

  • defer_lock : If true, does not lock the mutex immediately.

◆ ~hxunique_lock()

hxunique_lock::~hxunique_lock ( void )
inline

Unlocks the mutex if owned.

Member Function Documentation

◆ lock()

void hxunique_lock::lock ( void )
inline

Locks the mutex if not already locked.

◆ mutex()

hxmutex & hxunique_lock::mutex ( void )
inline

Returns a reference to the associated mutex.

◆ owns_lock()

bool hxunique_lock::owns_lock ( void ) const
inline

Returns true if the lock owns the mutex.

◆ unlock()

void hxunique_lock::unlock ( void )
inline

Unlocks the mutex if owned.


The documentation for this class was generated from the following file: