...
Acquired lock always must be released with $Cache.ReleaseLock method with generated token value. Otherwise lock is kept for long period until it's expire. (Default 5 min)
Example
Try to wait for a lock for a shared key and release it after operation is completed.
Code Block | ||
---|---|---|
| ||
$Cache.Set('myint', 4);
var tokenValue = $Cache.Lock('myint');
// Locked code block
$Cache.ReleaseLock('myint',tokenValue); |
Example
Code Block | ||
---|---|---|
| ||
$Cache.Set('myint', 4); var tokenValue = $Cache.Lock('myint'); // Locked code block $Cache.ReleaseLock('myint',tokenValue); |
...