ReaderWriterLockSlim.ExitWriteLock Method

Definition

Reduces the recursion count for write mode, and exits write mode if the resulting count is 0 (zero).

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

Exceptions

The current thread has not entered the lock in write mode.

Examples

The following example shows how to use a finally block to execute the ExitWriteLock method, ensuring that the caller exits write mode. The method shown in the example adds a new key/value pair to the synchronized cache. If the key is already in the cache, the exception thrown by the inner