ReaderWriterLock Konstruktor
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Inicializuje novou instanci ReaderWriterLock třídy.
public:
ReaderWriterLock();
public ReaderWriterLock();
Public Sub New ()
Příklady
Následující příklad kódu ukazuje, jak vytvořit novou instanci ReaderWriterLock třídy.
Tento kód je součástí většího příkladu poskytovaného ReaderWriterLock pro třídu.
// 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