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

#include <hxthread.hpp>

Public Member Functions

 hxmutex (void)
 ~hxmutex (void)
bool lock (void)
bool unlock (void)
inline::mtx_t * native_handle (void)

Detailed Description

hxmutex - std::mutex style wrapper for the configured threading backend.

Default behavior is non-recursive and no translation layer.

Constructor & Destructor Documentation

◆ hxmutex()

hxmutex::hxmutex ( void )
inline

Constructs a mutex and initializes it.

May not return if the mutex can't be initialized correctly. Something is very wrong if this fails.

◆ ~hxmutex()

hxmutex::~hxmutex ( void )
inline

Destroys the mutex.

Member Function Documentation

◆ lock()

bool hxmutex::lock ( void )
inline

Locks the mutex.

Returns true on success, asserts on invalid arguments, and returns false on failure. Callers must check the return value and avoid ignoring lock failures.

◆ native_handle()

inline::mtx_t * hxmutex::native_handle ( void )
inline

Returns a pointer to the native mutex handle.

◆ unlock()

bool hxmutex::unlock ( void )
inline

Unlocks the mutex.

Returns true on success and false otherwise. It is undefined to unlock a mutex that you have not locked, and such an operation may succeed.


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