TextWriter.Synchronized(TextWriter) Méthode

Définition

Crée un wrapper thread-safe autour du wrapper spécifié TextWriter.

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

Paramètres

writer
TextWriter

À TextWriter synchroniser.

Retours

Wrapper thread-safe.

Exceptions

writer a la valeur null.

Remarques

Toutes les opérations d’écriture dans le wrapper retourné seront thread-safe. Vous appelez cette méthode pour vous assurer qu’un seul thread à la fois peut exécuter les méthodes sur l’instance TextWriter retournée. Pour plus d’informations sur la synchronisation et le threading, consultez Synchronisation des données pour la multithreading.

Pour obtenir la liste des tâches d’E/S courantes, consultez Tâches d’E/S courantes.

S’applique à

Voir aussi