Rhino C++ API
8.14
|
#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 ()=default | |
int | BreakLock () |
bool | GetDefaultLock () |
bool | GetLock (int lock_value) |
int | IsLocked () |
bool | ReturnDefaultLock () |
bool | ReturnLock (int lock_value) |
Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
For complete openNURBS copyright information see http://www.opennurbs.org. Description: ON_Lock is a thread safe lock semaphore. It is implemented using platform specific compare and set functions.
anonymous enum : int |
ON_Lock::InvalidLockValue (= -1) may never be used as a lock value.
Copy constructor and operator= are implicitly deleted because __atomic_base<int, false> has a deleted copy constructor ON_Lock(const ON_Lock&) = default; ON_Lock& operator=(const ON_Lock&) = default;
Enumerator | |
---|---|
UnlockedValue | |
DefaultLockedValue | |
InvalidLockValue |
|
default |
|
default |
int ON_Lock::BreakLock | ( | ) |
Description: Unconditionally sets the lock value to ON_Lock::UnlockedValue. Returns: previous value of the lock. ON_Lock::UnlockedValue indicates the lock was available otherwise the lock passed to GetLock() is returned
bool ON_Lock::GetDefaultLock | ( | ) |
Description: Calls GetLock(ON_Lock::DefaultLockedValue); Returns: True if the lock state was unlocked and the current lock value was changed from ON_Lock::UnlockedValue to ON_Lock::DefaultLockedValue. False otherwise.
bool ON_Lock::GetLock | ( | int | lock_value | ) |
Parameters: lock_value - [in] any value except ON_Lock::UnlockedValue or ON_Lock::InvalidLockValue. Typically ON_Lock::DefaultLockedValue is used. Returns: True if the lock_value parameter was valid and the current lock value was changed from ON_Lock::UnlockedValue to lock_value. False otherwise.
int ON_Lock::IsLocked | ( | ) |
Returns: Current lock value ON_Lock::UnlockedValue indicates the the resource protected by the lock is available.
bool ON_Lock::ReturnDefaultLock | ( | ) |
Description: Calls ReturnLock(ON_Lock::DefaultLockedValue); Returns: True if the lock state was locked with a lock value = ON_Lock::DefaultLockedValue and the current lock value was changed from ON_Lock::DefaultLockedValue to ON_Lock::UnlockedValue. False otherwise.
bool ON_Lock::ReturnLock | ( | int | lock_value | ) |
Parameters: lock_value - [in] any value except ON_Lock::UnlockedValue or ON_Lock::InvalidLockValue. Typically this is the value that was passed to GetLock(). Returns: True if the lock_value parameter was valid and the current lock value was changed from that value to zero. False otherwise.