Mutex
classin packageklyn.threading
public class Mutex extends Object implements AutoClosable
└ 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
Inherited Properties
propertyInherited Properties 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.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml
methodInherited Methods from AutoClosable: close