Redigera

Dela via


Lock.Scope.Dispose Method

Definition

Exits the lock if the Lock.Scope represents a lock that was entered.

public:
 void Dispose();
public void Dispose ();
member this.Dispose : unit -> unit
Public Sub Dispose ()

Exceptions

The Lock.Scope represents a lock that was entered and the current thread does not hold the lock.

Remarks

If the current thread holds the lock multiple times, such as recursively, the lock is exited only once. The current thread should ensure that each EnterScope is matched with a Dispose on the Scope returned by EnterScope.

For more information, see the Remarks for Lock.Scope.

Applies to