ReaderWriterLock Constructor ()

 

Initializes a new instance of the ReaderWriterLock class.

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

public ReaderWriterLock()

The following code example demonstrates how to create a new instance of the ReaderWriterLock class.

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

// The complete code is located in the ReaderWriterLock class topic.
using System;
using System.Threading;

public class Example
{
   static ReaderWriterLock rwl = new ReaderWriterLock();
   // Define the shared resource protected by the ReaderWriterLock.
   static int resource = 0;

.NET Framework
Available since 1.1
Return to top
Show: