TextWriter.Synchronized(TextWriter) Metodo

Definizione

Crea un wrapper thread-safe per l'oggetto TextWriter specificato.

public:
 static System::IO::TextWriter ^ Synchronized(System::IO::TextWriter ^ writer);
public static System.IO.TextWriter Synchronized (System.IO.TextWriter writer);
static member Synchronized : System.IO.TextWriter -> System.IO.TextWriter
Public Shared Function Synchronized (writer As TextWriter) As TextWriter

Parametri

writer
TextWriter

Oggetto TextWriter da sincronizzare.

Restituisce

TextWriter

Wrapper thread-safe.

Eccezioni

writer è null.

Commenti

Tutte le operazioni di scrittura nel wrapper restituito saranno thread safe. Si chiama questo metodo per assicurarsi che solo un thread alla volta possa eseguire i metodi nell'istanza TextWriter restituita. Per altre informazioni sulla sincronizzazione e il threading, vedere Sincronizzazione dei dati per multithreading.

Per un elenco di attività di I/O comuni, vedere Attività di I/O comuni.

Si applica a

Vedi anche