Mutex
class in package klyn.threading

    public class Mutex extends Object implements AutoClosable:

Object
└ Mutex
All Implemented Interfaces: AutoClosable

Mutual exclusion primitive.

`lock()` acquires the mutex and returns an AutoClosable guard to support:

    try mutex.lock():
    # critical section
    pass

Properties inherited from Object: type
Methods

Modifier and Type | Member | Description
--- | --- | ---
public | close `close() as Void:` | AutoClosable support for try-with-resources.
public | lock `lock() as Mutex:` | Acquires the mutex and returns a guard that unlocks on `close()`.
public | unload `unload() as Void:` | Alias for unlock (kept for compatibility with older naming).
public | unlock `unlock() as Void:` | Releases the mutex.

Methods inherited from Object: fromJson, toDict, toJson, toString, toXml
Methods inherited from AutoClosable: close