Class threads.thread.mutex

Lua thread mutex creation and manipulation methods.

Functions

init ( ) Initialize a new mutex.
lock ( mutex ) Obtain a mutex lock.
unlock ( mutex ) Release a mutex lock.
destroy ( mutex ) Destroy an initialized mutex and free its resources.


Functions

init ( )
Initialize a new mutex.

Usage:

Return value:

An initialized mutex
lock ( mutex )
Obtain a mutex lock

Parameters

  • cond: Intialized mutex

Usage:

Return value:

0 successful lock, 1 failed to obtain the lock
unlock ( mutex )
Release a mutex lock.

Parameters

  • cond: Intialized mutex

Usage

Return value:

0 successful unlock, 1 failed to release the lock

See also:

destroy ( mutex )
Destroy an initialized mutex and free its resources.

Parameters

  • mutex: An intialized mutex

Return value:

0 success, 1 on failure.

Valid XHTML 1.0!