Enum AsyncReaderWriterResourceLock<TMoniker, TResource>.LockFlags
- Namespace
- Microsoft.VisualStudio.Threading
- Assembly
- Microsoft.VisualStudio.Threading.dll
Flags that modify default lock behavior.
[Flags]
public enum AsyncReaderWriterResourceLock<TMoniker, TResource>.LockFlags
Fields
None = 0
The default behavior applies.
SkipInitialPreparation = 4096
Skips a step to make sure that the resource is initially prepared when retrieved using GetResourceAsync.
This flag is dormant for non-write locks. But if present on an upgradeable read lock, this flag will activate for a nested write lock.
StickyWrite = 1
Causes an upgradeable reader to remain in an upgraded-write state once upgraded, even after the nested write lock has been released.
This is useful when you have a batch of possible write operations to apply, which may or may not actually apply in the end, but if any of them change anything, all of their changes should be seen atomically (within a single write lock). This approach is preferable to simply acquiring a write lock around the batch of potential changes because it doesn't defeat concurrent readers until it knows there is a change to actually make.