-
Notifications
You must be signed in to change notification settings - Fork 1
mint.lock guard
Palamecia edited this page Dec 4, 2022
·
1 revision
load mint.lock-guard
This module provides the LockGuard class which allow to perform a scoped System.Mutex lock.
This class provides a scoped lock mechanism. It allows to ensure that the System.Mutex lock is released after a function call.
def thread_safe_operation(mutex) {
lock = LockGuard(mutex)
// Perform 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. |
const |
new | Creates a new lock on the mutex. |
| Modifiers | Member | Description |
|---|---|---|
final |
mutex | Internal mutex. |
def (self)
Releases the lock when the object is deleted.
null
Internal mutex.
def (self, mutex)
Creates a new lock on the mutex.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules