LC.mutex.*¶
The module LC.mutex provides so-called “mutexes” to synchronize multiple Lua threads.
-
LC.mutex.debug(enable)¶ -
- Arguments
-
-
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)¶ -
- Arguments
-
-
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)¶ -
- Arguments
-
-
name (String) – mutex name
-
Release the lock for the mutex named
mutex. That mutex must have been locked before, otherwise undefined errors may occur.