Read Lock class to obtain and hold a read lock on the READWRITESYNC object until dtor is called Multiple threads can obtain read locks at the same time. More...
#include <mi32/readwritelock.h>
Public Member Functions | |
| READLOCK (READWRITESYNC &rwsync, bool bInitialLock=true, bool bTryLock=false) | |
| READLOCK () | |
| ~READLOCK () | |
| bool | IsLocked () const |
| void | Lock (READWRITESYNC &rwsync) |
| void | Lock () |
| bool | TryLock (READWRITESYNC &rwsync) |
| bool | TryLock () |
| void | Unlock () |
Read Lock class to obtain and hold a read lock on the READWRITESYNC object until dtor is called Multiple threads can obtain read locks at the same time.
| MITHREAD::READWRITESYNC::READLOCK::READLOCK | ( | ) |
Default ctor.
| MITHREAD::READWRITESYNC::READLOCK::READLOCK | ( | READWRITESYNC & | rwsync, | |
| bool | bInitialLock = true, |
|||
| bool | bTryLock = false | |||
| ) |
Pre-init ctor.
| rwsync | Synchronization read/write object to obtain a read lock on | |
| bInitialLock | Get a lock on ctor call, false to obtain one later | |
| bTryLock | Use try lock semantics, call IsLocked() to determine if lock is granted, recursion support must be enabled |
| MITHREAD::READWRITESYNC::READLOCK::~READLOCK | ( | ) |
Default dtor, will release the lock if IsLocked() == true.
| bool MITHREAD::READWRITESYNC::READLOCK::IsLocked | ( | ) | const [inline] |
Determine that a lock was obtained, only useful if ctor is passed 'true' for bTryLock parameter.
| void MITHREAD::READWRITESYNC::READLOCK::Lock | ( | READWRITESYNC & | rwsync | ) |
Obtains a lock on READWRITESYNC object passed in.
| rwsync | Synchronization read/write object to obtain a read lock on |
| void MITHREAD::READWRITESYNC::READLOCK::Lock | ( | ) |
Obtains a lock on READWRITESYNC object passed in the ctor. Only useful if 'false' is passed in bInitialLock parameter.
| bool MITHREAD::READWRITESYNC::READLOCK::TryLock | ( | READWRITESYNC & | rwsync | ) |
Attempts to obtain a lock on READWRITESYNC object passed in the ctor.
Only useful if recursion support is enabled.
| rwsync | Synchronization read/write object to obtain a read lock on |
| bool MITHREAD::READWRITESYNC::READLOCK::TryLock | ( | ) |
Attempts to obtain a lock on READWRITESYNC object passed in the ctor.
Only useful if 'false' is passed in bInitialLock parameter and recursion support is enabled.
| void MITHREAD::READWRITESYNC::READLOCK::Unlock | ( | ) |
Releases the lock on READWRITESYNC object.
1.6.1