ReaderWriterLock Konstruktor
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Inicjuje nowe wystąpienie klasy ReaderWriterLock.
public:
ReaderWriterLock();
public ReaderWriterLock();
Public Sub New ()
Przykłady
W poniższym przykładzie kodu pokazano, jak utworzyć nowe wystąpienie ReaderWriterLock klasy.
Ten kod jest częścią większego przykładu udostępnionego ReaderWriterLock dla klasy .
// 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