LassoScript Utility
Basics Browse Detail

[Thread_Lock]

Tag Link [Thread_Lock] Category Threads
Type Substitution Source Available No
Support Preferred Version 6.0
Change Unchanged Data Source Any
Output Type Thread_Lock Security Tag
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Description

Creates a lock that can be used to control concurrent access to a shared resource such as a global server-wide variable or a file.

A thread lock can be locked using the [Thread_Lock->Lock] tag or unlocked using the [Thread_Lock->Unlock] tag.

Once a thread lock is locked, any subsequent attempts to acquire a lock will wait until the thread is unlocked. If several pages attempt to acquire a lock simultaneously, one will end up the lock and the others will have to wait until it has released it before they can access the same resource.

Note: The use of thread tools is entirely voluntary. There is nothing in Lasso that prevents access to the same shared resource, but the diligent use of the thread tools will ensure predictable results.

Syntax

[Global: 'myLock' = (Thread_Lock)]

[if: $myLock->(Lock: 1000)]
...
[$myLock->(Unlock)]
[/If]

Parameters

No Parameters Required.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.