Skip to content

ReleaseLock

Releases a previously acquired lock.

1
$Cache.ReleaseLock(key: string, token: string):boolean

Parameters

string key
    The shared lock key. Required.

string token
    The lock token. Required.

Returns

true if the lock was released successfully; otherwise, false.

Remarks

The lock token is generated by the $Cache.Lock or $Cache.TryLock method.

Example

1
2
3
4
5
6
7
var tokenValue = $Cache.Lock('mylock');
try {
  // Locked code block
}
finally{
  $Cache.ReleaseLock('mylock',tokenValue);
}

See Also