You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need to be able to lock the entire cache—rather than a single key—to prevent any changes to the cache.
Such a lock should also block ‘GetLock’ methods, just as if someone had already acquired a lock on the key.
In other words, the ‘LockCache’ method acquires a lock on the entire cache.
The reverse is also true: if someone has already acquired a lock on a specific key via ‘GetLock’, then ‘LockCache’ will only be able to lock the entire cache once the lock on that specific key is released.
This type of locking is useful for batch operations when you need to make many insertions or updates to the cache. Currently, you have to lock all keys plus a dummy “0” key (which essentially acts as a lock to prevent the creation of new entries).
Activity