This class implements a lock shared over individual processes (a system-wide lock).
More...
This class implements a lock shared over individual processes (a system-wide lock).
- See also
- ScopedSharedLock, SharedMemory.
◆ SharedLock() [1/3]
Ocean::SharedLock::SharedLock |
( |
| ) |
|
|
default |
Creates an invalid shared lock object.
◆ SharedLock() [2/3]
Ocean::SharedLock::SharedLock |
( |
const std::wstring & |
name | ) |
|
|
explicit |
Creates a new shared lock object by a system unique name of this lock.
- Parameters
-
name | System wide unique lock name |
◆ SharedLock() [3/3]
Ocean::SharedLock::SharedLock |
( |
const SharedLock & |
sharedLock | ) |
|
|
delete |
Disabled copy constructor.
- Parameters
-
sharedLock | Shared lock object to be copied |
◆ ~SharedLock()
Ocean::SharedLock::~SharedLock |
( |
| ) |
|
Destructs a shared lock object.
◆ createSemaphore()
bool Ocean::SharedLock::createSemaphore |
( |
| ) |
|
|
private |
Creates the semaphore object of this lock.
- Returns
- True, if succeeded
◆ isValid()
bool Ocean::SharedLock::isValid |
( |
| ) |
const |
|
inline |
Returns whether this object is valid and can be used correctly.
- Returns
- True, if so
◆ lock()
void Ocean::SharedLock::lock |
( |
| ) |
|
◆ name()
const std::wstring & Ocean::SharedLock::name |
( |
| ) |
const |
|
inline |
Returns the system wide unique name of this lock.
- Returns
- Lock name
◆ operator bool()
Ocean::SharedLock::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Returns whether this object is valid and can be used correctly.
- Returns
- True, if so
◆ operator=()
Disabled assign operator.
- Parameters
-
sharedLock | Shared lock object to be assigned |
- Returns
- Reference to this object
◆ tryLock()
bool Ocean::SharedLock::tryLock |
( |
| ) |
|
Tries to lock the mutex.
Beware: This object must have a valid name before locking!
- Returns
- True, if the mutex could be locked
- See also
- unlock(), lock(), name(), isValid().
◆ unlock()
void Ocean::SharedLock::unlock |
( |
| ) |
|
Unlocks the mutex.
Beware: This object must have a valid name before locking!
- See also
- lock(), name(), isVaid().
◆ handle_
void* Ocean::SharedLock::handle_ = nullptr |
|
private |
◆ localCounter_
unsigned int Ocean::SharedLock::localCounter_ = 0u |
|
private |
◆ localLock_
Lock Ocean::SharedLock::localLock_ |
|
private |
◆ name_
std::wstring Ocean::SharedLock::name_ |
|
private |
The documentation for this class was generated from the following file: