ReaderWriterLock.ReleaseLock Method ()

 

Releases the lock, regardless of the number of times the thread acquired the lock.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

member ReleaseLock : unit -> LockCookie

Return Value

Type: System.Threading.LockCookie

A LockCookie value representing the released lock.

ReleaseLock releases the reader lock or writer lock, regardless of the recursive lock count. To restore the state of the lock, including the lock count, pass the LockCookie to RestoreLock.

The following code example shows how to use the ReleaseLock method to release the lock, regardless of how many times it has been acquired by the thread, and how to restore the state of the lock later.

This code is part of a larger example provided for the ReaderWriterLock class.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: