Stream.Synchronized(Stream) Stream.Synchronized(Stream) Stream.Synchronized(Stream) Method

定义

在指定的 Stream 对象周围创建线程安全(同步)包装。Creates a thread-safe (synchronized) wrapper around the specified Stream object.

public:
 static System::IO::Stream ^ Synchronized(System::IO::Stream ^ stream);
public static System.IO.Stream Synchronized (System.IO.Stream stream);
static member Synchronized : System.IO.Stream -> System.IO.Stream

参数

stream
Stream Stream Stream

要同步的 Stream 对象。The Stream object to synchronize.

返回

一个线程安全的 Stream 对象。A thread-safe Stream object.

异常

注解

此方法返回一个包装指定的类Stream对象,并会限制对它从多个线程访问。This method returns a class that wraps the specified Stream object and restricts access to it from multiple threads. 所有访问Stream对象将是线程安全。All access to the Stream object will be thread safe.

适用于