Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cThreadLockBase Class Reference

#include <cThreadLock.h>

Inheritance diagram for Gray::cThreadLockBase:
Gray::cLockableBase Gray::cNonCopyable Gray::cThreadLockFast Gray::cThreadLockMutex Gray::cThreadLockRW Gray::cThreadLockableRW

Public Member Functions

 cThreadLockBase () noexcept
 
bool isLocked () const noexcept
 
THREADID_t get_ThreadLockOwner () const
 
bool isThreadLockedByCurrent () const noexcept
 

Protected Member Functions

THREADID_t __DECL_ALIGN (_SIZEOF_THREADID) m_nLockThreadID
 The thread that has the lock. cThreadId:k_NULL is not locked. More...
 
- Protected Member Functions inherited from Gray::cLockableBase
 cLockableBase () noexcept
 
 ~cLockableBase ()
 
LONG get_LockCount () const
 
bool isLocked () const
 
void IncLockCount ()
 
LONG DecLockCount ()
 
void Lock ()
 
LONG Unlock ()
 
- Protected Member Functions inherited from Gray::cNonCopyable
 cNonCopyable () noexcept
 Force the use of Factory creation via protected constructor. More...
 
 ~cNonCopyable () noexcept
 

Detailed Description

ASSUME sizeof(THREADID_t) <= sizeof(UINT_PTR) _SIZEOF_PTR for __DECL_ALIGN.

Constructor & Destructor Documentation

◆ cThreadLockBase()

Gray::cThreadLockBase::cThreadLockBase ( )
inlinenoexcept

Member Function Documentation

◆ __DECL_ALIGN()

THREADID_t Gray::cThreadLockBase::__DECL_ALIGN ( _SIZEOF_THREADID  )
protected

The thread that has the lock. cThreadId:k_NULL is not locked.

◆ get_ThreadLockOwner()

THREADID_t Gray::cThreadLockBase::get_ThreadLockOwner ( ) const
inline
Returns
cThreadId::k_NULL = not locked.

◆ isLocked()

bool Gray::cThreadLockBase::isLocked ( ) const
inlinenoexcept

Only thread safe way to test this is to look at m_nLockThreadID, NOT m_nLockCount

◆ isThreadLockedByCurrent()

bool Gray::cThreadLockBase::isThreadLockedByCurrent ( ) const
inlinenoexcept

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