LC.mutex.*¶
The module LC.mutex
provides so-called „mutexes“ to synchronize multiple Lua threads.
-
LC.mutex.
debug
(enable)¶ -
- Parameter
-
-
enable (Boolean) – enable/disable debug logging
-
Enable or disable debugging of mutex operations. With debugging enabled, every call of
LC.mutex.lock()
andLC.mutex.unlock()
will be logged (usingLC.log.print()
).
-
LC.mutex.
lock
(name)¶ -
- Parameter
-
-
name (String) – mutex name
-
Lock the mutex named
mutex
. If no mutex exists with that name, a new one is created automatically.
-
LC.mutex.
unlock
(name)¶ -
- Parameter
-
-
name (String) – mutex name
-
Release the lock for the mutex named
mutex
. That mutex must have been locked before, otherwise undefined errors may occur.