Share via


AsyncReaderWriterLock.HideLocks Method

Definition

Prevents use or visibility of the caller's lock(s) until the returned value is disposed.

public:
 Microsoft::VisualStudio::Threading::AsyncReaderWriterLock::Suppression HideLocks();
public Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.Suppression HideLocks ();
member this.HideLocks : unit -> Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.Suppression
Public Function HideLocks () As AsyncReaderWriterLock.Suppression

Returns

The value to dispose to restore lock visibility.

Remarks

This can be used by a write lock holder that is about to fork execution to avoid two threads simultaneously believing they hold the exclusive write lock. The lock should be hidden just before kicking off the work and can be restored immediately after kicking off the work.

Applies to