-
Notifications
You must be signed in to change notification settings - Fork 2
mint.lockguard
Palamecia edited this page Dec 4, 2022
·
6 revisions
load mint.lockguard
This module provides the LockGuard class which allow to perform a scoped System.Mutex lock.
This class provides a scoped lock mecanisme. It allows to ensure that the System.Mutex lock is released after a function call.
Example:
def thread_safe_operation(mutex) {
lock = LockGuard(mutex)
// Performe critical operation
}
Note
The lock can also be released by deleting the object.
Modifiers | Member | Description |
---|---|---|
+ const
|
delete | Releases the lock when the object is deleted. |
- final
|
mutex | Internal mutex. |
+ const
|
new | Creates a new lock on the mutex . |
def (self)
Releases the lock when the object is deleted.
null
Internal mutex.
def (self, mutex)
Creates a new lock on the mutex
.
Language reference
- Introduction
- Variables
- Built-in types
- Arithmetic operations
- Type casting
- Control structures
- Function definition
- User defined types
- Work with modules
Library reference