![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cThreadLock.h>
Public Member Functions | |
| cThreadLockFast () noexcept | |
| cThreadLockFast (const cThreadLockFast &a) noexcept | |
| ~cThreadLockFast () noexcept | |
| bool | ClearThreadLockOwner (THREADID_t nTid) |
| void | Lock () |
| bool | LockTry (TIMESYSD_t dwDelayMS=0) |
| void | Unlock () |
Public Member Functions inherited from Gray::cThreadLockBase | |
| cThreadLockBase () noexcept | |
| bool | isLocked () const noexcept |
| THREADID_t | get_ThreadLockOwner () const |
| bool | isThreadLockedByCurrent () const noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from Gray::cThreadLockBase | |
| 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 | |
used with any data structure that may be locked for multi threaded access. These are fairly cheap and fast. Slow on actual collision. (but collide assumed to be infrequent)
|
inlinenoexcept |
|
inlinenoexcept |
Copy constructor should never actually be called! but if it is, just make a new copy that is not locked! pretend we copied stuff?
|
inlinenoexcept |
|
inline |
Special case if a thread is hard terminated. Only clear if nTid is the current owner.
| void Gray::cThreadLockFast::Lock | ( | ) |
Take ownership if the lock is free or owned by the calling thread. Wait forever for a collision to clear.
| bool Gray::cThreadLockFast::LockTry | ( | TIMESYSD_t | dwDelayMS = 0 | ) |
inline version of this made bad code? Take ownership if the lock is free or owned by the calling thread
|
inline |
inline version of this made bad code? ASSUME I own the lock. so this call doesn't really need to be thread safe.