ReaderWriterLock Konstruktor

Definíció

Inicializálja a ReaderWriterLock osztály új példányát.

public:
 ReaderWriterLock();
public ReaderWriterLock();
Public Sub New ()

Példák

Az alábbi példakód bemutatja, hogyan hozható létre az ReaderWriterLock osztály új példánya.

Ez a kód egy nagyobb, az ReaderWriterLock osztályhoz tartozó példa része.

// 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;
' The complete code is located in the ReaderWriterLock class topic.
Imports System.Threading

Public Module Example
   Private rwl As New ReaderWriterLock()
   ' Define the shared resource protected by the ReaderWriterLock.
   Private resource As Integer = 0
}
End Module

A következőre érvényes:

Lásd még