Skip to main content

Name

msys.lock — The current running OS level thread obtains a lock on the named mutex

Synopsis

msys.lock(mutexname);

mutexname: string

Description

The current running OS level thread obtains a lock on the named mutex. The caller is responsible for releasing the lock at the earliest appropriate opportunity. Note that the lock is not automatically released when the script is de-scheduled (for example, via msys.sleep, msys.readfile or the msys.db.query functions), so exercise caution.

For example code see thread.mutex.

Because this function is in the msys namespace, an explicit require is not necessary.

See Also

Was this page helpful?