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() and LC.mutex.unlock() will be logged (using LC.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.


Last updated on Nov 05, 2019.
next: LC.sys.*
previous: LC.log.*