Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextReader.Synchronized Method (TextReader)


Creates a thread-safe wrapper around the specified TextReader.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)]
public static TextReader Synchronized(
	TextReader reader


Type: System.IO.TextReader

The TextReader to synchronize.

Return Value

Type: System.IO.TextReader

A thread-safe TextReader.

Exception Condition

reader is null.

The current method returns a class that wraps around the specified TextReader instance and restricts access to it by multiple threads. All reads from the returned wrapper will be thread safe.

.NET Framework
Available since 1.1
Return to top
© 2017 Microsoft