RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::Threading::ReentrantLock Class Reference

A ReentrantLock is owned by the thread last successfully locking, but not yet unlocking it. A thread invoking lock will return, successfully acquiring the lock, when the lock is not owned by another thread. The method will return immediately if the current thread already owns the lock. More...

Inheritance diagram for System::Threading::ReentrantLock:
System::Threading::IntrinsicLock

Public Member Functions

RLIB_INLINE void Lock () const
 Acquires an exclusive lock. More...
 
RLIB_INLINE bool TryLock () const
 Attempts to acquire an exclusive lock. More...
 
RLIB_INLINE void UnLock () const
 Releases an exclusive lock. More...
 
RLIB_INLINE long GetHoldCount ()
 Queries the number of holds on this lock by the current thread. A thread has a hold on a lock for each lock action that is not matched by an unlock action. The hold count information is typically only used for testing and debugging purposes. More...
 
 RLIB_PROPERTY_GET (long HoldCount, GetHoldCount)
 Queries the number of holds on this lock by the current thread. A thread has a hold on a lock for each lock action that is not matched by an unlock action. The hold count information is typically only used for testing and debugging purposes. More...
 
RLIB_INLINE ReentrantLock (_In_ DWORD)
 
RLIB_INLINE void Enter () const
 Acquires an exclusive lock. More...
 
RLIB_INLINE bool TryEnter () const
 Attempts to acquire an exclusive lock. More...
 
RLIB_INLINE void Exit () const
 Releases an exclusive lock. More...
 

Protected Attributes

volatile long l
 

Detailed Description

A ReentrantLock is owned by the thread last successfully locking, but not yet unlocking it. A thread invoking lock will return, successfully acquiring the lock, when the lock is not owned by another thread. The method will return immediately if the current thread already owns the lock.

Member Function Documentation

RLIB_INLINE void System::Threading::ReentrantLock::Enter ( ) const
inline

Acquires an exclusive lock.

RLIB_INLINE void System::Threading::ReentrantLock::Exit ( ) const
inline

Releases an exclusive lock.

RLIB_INLINE long System::Threading::ReentrantLock::GetHoldCount ( )
inline

Queries the number of holds on this lock by the current thread. A thread has a hold on a lock for each lock action that is not matched by an unlock action. The hold count information is typically only used for testing and debugging purposes.

RLIB_INLINE void System::Threading::ReentrantLock::Lock ( ) const
inline

Acquires an exclusive lock.

System::Threading::ReentrantLock::RLIB_PROPERTY_GET ( long  HoldCount,
GetHoldCount   
)

Queries the number of holds on this lock by the current thread. A thread has a hold on a lock for each lock action that is not matched by an unlock action. The hold count information is typically only used for testing and debugging purposes.

RLIB_INLINE bool System::Threading::ReentrantLock::TryEnter ( ) const
inline

Attempts to acquire an exclusive lock.

RLIB_INLINE bool System::Threading::ReentrantLock::TryLock ( ) const
inline

Attempts to acquire an exclusive lock.

RLIB_INLINE void System::Threading::ReentrantLock::UnLock ( ) const
inline

Releases an exclusive lock.


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