Skip to content

mint.lockguard

Palamecia edited this page Dec 4, 2022 · 6 revisions

Module

load mint.lockguard

This module provides the LockGuard class which allow to perform a scoped System.Mutex lock.

Classes

LockGuard

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.

Members

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.

Descriptions

LockGuard.delete

def (self)

Releases the lock when the object is deleted.

LockGuard.mutex

null

Internal mutex.

LockGuard.new

def (self, mutex)

Creates a new lock on the mutex.

Clone this wiki locally