Stream.Synchronized(Stream) 方法

定義

建立一個執行緒安全(同步)的包裝器,包圍指定 Stream 物件。

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
Public Shared Function Synchronized (stream As Stream) As Stream

參數

stream
Stream

Stream要同步的物件。

傳回

一個安全執行緒的 Stream 物件。

例外狀況

streamnull

備註

此方法回傳一個類別,包裹指定 Stream 物件並限制多個執行緒對其的存取。 所有對物件 Stream 的存取都會是執行緒安全的。

適用於