ON_Lock is a thread safe lock semephore. It is implemented using platform specfic compare and set functions. More...
#include <opennurbs_lock.h>
Public Types | |
enum | : int { UnlockedValue = 0, DefaultLockedValue = 1, InvalidLockValue = -1 } |
ON_Lock::InvalidLockValue (= -1) may never be used as a lock value. More... | |
Public Member Functions | |
ON_Lock ()=default | |
ON_Lock (const ON_Lock &)=default | |
~ON_Lock ()=default | |
int | BreakLock () |
Unconditionally sets the lock value to ON_Lock::UnlockedValue. More... | |
bool | GetDefaultLock () |
Calls GetLock(ON_Lock::DefaultLockedValue); More... | |
bool | GetLock (int lock_value) |
int | IsLocked () |
ON_Lock & | operator= (const ON_Lock &)=default |
bool | ReturnDefaultLock () |
Calls ReturnLock(ON_Lock::DefaultLockedValue); More... | |
bool | ReturnLock (int lock_value) |
ON_Lock is a thread safe lock semephore. It is implemented using platform specfic compare and set functions.
anonymous enum : int |
ON_Lock::InvalidLockValue (= -1) may never be used as a lock value.
Enumerator | |
---|---|
UnlockedValue | |
DefaultLockedValue | |
InvalidLockValue |
|
default |
|
default |
|
default |
int ON_Lock::BreakLock | ( | ) |
Unconditionally sets the lock value to ON_Lock::UnlockedValue.
bool ON_Lock::GetDefaultLock | ( | ) |
Calls GetLock(ON_Lock::DefaultLockedValue);
bool ON_Lock::GetLock | ( | int | lock_value | ) |
lock_value | [in] any value except ON_Lock::UnlockedValue or ON_Lock::InvalidLockValue. Typically ON_Lock::DefaultLockedValue is used. |
int ON_Lock::IsLocked | ( | ) |
bool ON_Lock::ReturnDefaultLock | ( | ) |
Calls ReturnLock(ON_Lock::DefaultLockedValue);
bool ON_Lock::ReturnLock | ( | int | lock_value | ) |
lock_value | [in] any value except ON_Lock::UnlockedValue or ON_Lock::InvalidLockValue. Typically this is the value that was passed to GetLock(). |