AutoResetEventとは? わかりやすく解説

AutoResetEvent クラス

イベントが発生したことを待機中のスレッドに通知します。このクラスは継承できません。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public NotInheritable Class
 AutoResetEvent
    Inherits EventWaitHandle
Dim instance As AutoResetEvent
[ComVisibleAttribute(true)] 
public sealed class AutoResetEvent : EventWaitHandle
[ComVisibleAttribute(true)] 
public ref class AutoResetEvent sealed : public
 EventWaitHandle
/** @attribute ComVisibleAttribute(true) */ 
public final class AutoResetEvent extends EventWaitHandle
ComVisibleAttribute(true) 
public final class AutoResetEvent extends
 EventWaitHandle
解説解説
メモメモ

このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、Synchronization または ExternalThreading です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。

.NET Framework Version 2.0 では、AutoResetEvent は新しい EventWaitHandle クラスから派生します。AutoResetEvent は、機能的には EventResetMode.AutoReset で作成した EventWaitHandle と同等です。

AutoResetEvent を使用すると、スレッドはシグナルを通じて相互に通信できます。通常、このような通信は、複数のスレッドが 1 つのリソースに対して排他的なアクセスを必要とする場合に使用します。

スレッドは AutoResetEvent の WaitOne を呼び出すことによってシグナルを待機します。AutoResetEvent が非シグナル状態の場合、スレッドはブロックし、リソースを現在制御しているスレッドが Set を呼び出すことによってリソースが使用可能になったことをシグナル通知するまで待機します。

Set を呼び出すと、AutoResetEvent にシグナルが送られ、待機しているスレッドが解放されます。AutoResetEvent は、待機している最後のスレッドが解放されるまでシグナル状態のままとなり、最後のスレッドが解放されると自動的に非シグナル状態に戻ります。待機中のスレッドがない場合、状態は無限にシグナル状態のままです。

AutoResetEvent の初期状態は、コンストラクタに Boolean 値を渡すことによって制御できます。初期状態をシグナル状態にする場合は true を渡し、それ以外の場合は false を渡します。

AutoResetEvent は、staticWaitAll メソッドおよび WaitAny メソッドでも使用できます。

スレッドの同期機構の詳細については、概念説明のドキュメントの「AutoResetEvent」を参照してください。

使用例使用例

待機ハンドルを使用して、複雑な数値計算の各段階の完了をシグナル通知する例を次に示します。計算の形式は、result = first term + second term + third term です。各項目には、事前計算と、算出された基数を使用した最終計算が行われます。

Imports System
Imports System.Threading

Public Class CalculateTest

    <MTAThreadAttribute> _
    Shared Sub Main()
        Dim calc As New
 Calculate()
        Console.WriteLine("Result = {0}.", _
            calc.Result(234).ToString())
        Console.WriteLine("Result = {0}.", _
            calc.Result(55).ToString())
    End Sub
End Class

Public Class Calculate

    Dim baseNumber, firstTerm, secondTerm, thirdTerm As
 Double
    Dim autoEvents() As AutoResetEvent
    Dim manualEvent As ManualResetEvent

    ' Generate random numbers to simulate the actual calculations.
    Dim randomGenerator As Random 

    Sub New()
        autoEvents = New AutoResetEvent(2) { _
            New AutoResetEvent(False), _
            New AutoResetEvent(False), _
            New AutoResetEvent(False) }

        manualEvent = New ManualResetEvent(False)
    End Sub

    Private Sub CalculateBase(stateInfo As
 Object)
        baseNumber = randomGenerator.NextDouble()

        ' Signal that baseNumber is ready.
        manualEvent.Set()
    End Sub

    ' The following CalculateX methods all perform the same
    ' series of steps as commented in CalculateFirstTerm.

    Private Sub CalculateFirstTerm(stateInfo
 As Object)
    
        ' Perform a precalculation.
        Dim preCalc As Double
 = randomGenerator.NextDouble()

        ' Wait for baseNumber to be calculated.
        manualEvent.WaitOne()

        ' Calculate the first term from preCalc and baseNumber.
        firstTerm = preCalc * baseNumber * _
            randomGenerator.NextDouble()

        ' Signal that the calculation is finished.
        autoEvents(0).Set()
    End Sub

    Private Sub CalculateSecondTerm(stateInfo
 As Object)
        Dim preCalc As Double
 = randomGenerator.NextDouble()
        manualEvent.WaitOne()
        secondTerm = preCalc * baseNumber * _
            randomGenerator.NextDouble()
        autoEvents(1).Set()
    End Sub

    Private Sub CalculateThirdTerm(stateInfo
 As Object)
        Dim preCalc As Double
 = randomGenerator.NextDouble()
        manualEvent.WaitOne()
        thirdTerm = preCalc * baseNumber * _
            randomGenerator.NextDouble()
        autoEvents(2).Set()
    End Sub

    Function Result(seed As Integer)
 As Double

        randomGenerator = New Random(seed)

        ' Simultaneously calculate the terms.
        ThreadPool.QueueUserWorkItem(AddressOf CalculateBase)
        ThreadPool.QueueUserWorkItem(AddressOf CalculateFirstTerm)
        ThreadPool.QueueUserWorkItem(AddressOf CalculateSecondTerm)
        ThreadPool.QueueUserWorkItem(AddressOf CalculateThirdTerm)

        ' Wait for all of the terms to be calculated.
        WaitHandle.WaitAll(autoEvents)

        ' Reset the wait handle for the next calculation.
        manualEvent.Reset()

        Return firstTerm + secondTerm + thirdTerm
    End Function

End Class
using System;
using System.Threading;

class CalculateTest
{
    static void Main()
    {
        Calculate calc = new Calculate();
        Console.WriteLine("Result = {0}.", 
            calc.Result(234).ToString());
        Console.WriteLine("Result = {0}.", 
            calc.Result(55).ToString());
    }
}

class Calculate
{
    double baseNumber, firstTerm, secondTerm, thirdTerm;
    AutoResetEvent[] autoEvents;
    ManualResetEvent manualEvent;

    // Generate random numbers to simulate the actual calculations.
    Random randomGenerator;

    public Calculate()
    {
        autoEvents = new AutoResetEvent[]
        {
            new AutoResetEvent(false),
            new AutoResetEvent(false),
            new AutoResetEvent(false)
        };

        manualEvent = new ManualResetEvent(false);
    }

    void CalculateBase(object stateInfo)
    {
        baseNumber = randomGenerator.NextDouble();

        // Signal that baseNumber is ready.
        manualEvent.Set();
    }

    // The following CalculateX methods all perform the same
    // series of steps as commented in CalculateFirstTerm.

    void CalculateFirstTerm(object stateInfo)
    {
        // Perform a precalculation.
        double preCalc = randomGenerator.NextDouble();

        // Wait for baseNumber to be calculated.
        manualEvent.WaitOne();

        // Calculate the first term from preCalc and baseNumber.
        firstTerm = preCalc * baseNumber * 
            randomGenerator.NextDouble();

        // Signal that the calculation is finished.
        autoEvents[0].Set();
    }

    void CalculateSecondTerm(object stateInfo)
    {
        double preCalc = randomGenerator.NextDouble();
        manualEvent.WaitOne();
        secondTerm = preCalc * baseNumber * 
            randomGenerator.NextDouble();
        autoEvents[1].Set();
    }

    void CalculateThirdTerm(object stateInfo)
    {
        double preCalc = randomGenerator.NextDouble();
        manualEvent.WaitOne();
        thirdTerm = preCalc * baseNumber * 
            randomGenerator.NextDouble();
        autoEvents[2].Set();
    }

    public double Result(int seed)
    {
        randomGenerator = new Random(seed);

        // Simultaneously calculate the terms.
        ThreadPool.QueueUserWorkItem(
            new WaitCallback(CalculateBase));
        ThreadPool.QueueUserWorkItem(
            new WaitCallback(CalculateFirstTerm));
        ThreadPool.QueueUserWorkItem(
            new WaitCallback(CalculateSecondTerm));
        ThreadPool.QueueUserWorkItem(
            new WaitCallback(CalculateThirdTerm));

        // Wait for all of the terms to be calculated.
        WaitHandle.WaitAll(autoEvents);

        // Reset the wait handle for the next calculation.
        manualEvent.Reset();

        return firstTerm + secondTerm + thirdTerm;
    }
}
using namespace System;
using namespace System::Threading;
ref class Calculate
{
private:
   double baseNumber;
   double firstTerm;
   double secondTerm;
   double thirdTerm;
   array<AutoResetEvent^>^autoEvents;
   ManualResetEvent^ manualEvent;

   // Generate random numbers to simulate the actual calculations.
   Random^ randomGenerator;

public:
   Calculate()
   {
      autoEvents = gcnew array<AutoResetEvent^>(3);
      autoEvents[ 0 ] = gcnew AutoResetEvent( false );
      autoEvents[ 1 ] = gcnew AutoResetEvent( false );
      autoEvents[ 2 ] = gcnew AutoResetEvent( false );
      manualEvent = gcnew ManualResetEvent( false );
   }


private:
   void CalculateBase( Object^ /*stateInfo*/ )
   {
      baseNumber = randomGenerator->NextDouble();
      
      // Signal that baseNumber is ready.
      manualEvent->Set();
   }


   // The following CalculateX methods all perform the same
   // series of steps as commented in CalculateFirstTerm.
   void CalculateFirstTerm( Object^ /*stateInfo*/ )
   {
      
      // Perform a precalculation.
      double preCalc = randomGenerator->NextDouble();
      
      // Wait for baseNumber to be calculated.
      manualEvent->WaitOne();
      
      // Calculate the first term from preCalc and baseNumber.
      firstTerm = preCalc * baseNumber * randomGenerator->NextDouble();
      
      // Signal that the calculation is finished.
      autoEvents[ 0 ]->Set();
   }

   void CalculateSecondTerm( Object^ /*stateInfo*/ )
   {
      double preCalc = randomGenerator->NextDouble();
      manualEvent->WaitOne();
      secondTerm = preCalc * baseNumber * randomGenerator->NextDouble();
      autoEvents[ 1 ]->Set();
   }

   void CalculateThirdTerm( Object^ /*stateInfo*/ )
   {
      double preCalc = randomGenerator->NextDouble();
      manualEvent->WaitOne();
      thirdTerm = preCalc * baseNumber * randomGenerator->NextDouble();
      autoEvents[ 2 ]->Set();
   }


public:
   double Result( int seed )
   {
      randomGenerator = gcnew Random( seed );
      
      // Simultaneously calculate the terms.
      ThreadPool::QueueUserWorkItem( gcnew WaitCallback( this,
 &Calculate::CalculateBase ) );
      ThreadPool::QueueUserWorkItem( gcnew WaitCallback( this,
 &Calculate::CalculateFirstTerm ) );
      ThreadPool::QueueUserWorkItem( gcnew WaitCallback( this,
 &Calculate::CalculateSecondTerm ) );
      ThreadPool::QueueUserWorkItem( gcnew WaitCallback( this,
 &Calculate::CalculateThirdTerm ) );
      
      // Wait for all of the terms to be calculated.
      WaitHandle::WaitAll( autoEvents );
      
      // Reset the wait handle for the next calculation.
      manualEvent->Reset();
      return firstTerm + secondTerm + thirdTerm;
   }

};

int main()
{
   Calculate^ calc = gcnew Calculate;
   Console::WriteLine( "Result = {0}.", calc->Result( 234 ).ToString()
 );
   Console::WriteLine( "Result = {0}.", calc->Result( 55 ).ToString()
 );
}

import System.*;
import System.Threading.*;

class CalculateTest
{
    public static void main(String[]
 args)
    {
        Calculate calc = new Calculate();
        Console.WriteLine("Result = {0}.", String.valueOf(calc.Result(234)));
        Console.WriteLine("Result = {0}.", String.valueOf(calc.Result(55)));
    } //main
} //CalculateTest

class Calculate
{
    private double baseNumber, firstTerm, secondTerm, thirdTerm;
    private AutoResetEvent autoEvents[];
    private ManualResetEvent manualEvent;

    // Generate random numbers to simulate the actual calculations.
    private Random randomGenerator;

    public Calculate()
    {
        autoEvents = new AutoResetEvent[] { new
 AutoResetEvent(false), 
            new AutoResetEvent(false), new
 AutoResetEvent(false) };
        manualEvent = new ManualResetEvent(false);
    } //Calculate

    void CalculateBase(Object stateInfo)
    {
        baseNumber = randomGenerator.NextDouble();

        // Signal that baseNumber is ready.
        manualEvent.Set();
    } //CalculateBase

    // The following CalculateX methods all perform the same
    // series of steps as commented in CalculateFirstTerm.
    void CalculateFirstTerm(Object stateInfo)
    {
        // Perform a precalculation.
        double preCalc = randomGenerator.NextDouble();

        // Wait for baseNumber to be calculated.
        manualEvent.WaitOne();

        // Calculate the first term from preCalc and baseNumber.
        firstTerm = preCalc * baseNumber * randomGenerator.NextDouble();

        // Signal that the calculation is finished.
        autoEvents[0].Set();
    } //CalculateFirstTerm

    void CalculateSecondTerm(Object stateInfo)
    {
        double preCalc = randomGenerator.NextDouble();

        manualEvent.WaitOne();
        secondTerm = preCalc * baseNumber * randomGenerator.NextDouble();
        autoEvents[1].Set();
    } //CalculateSecondTerm

    void CalculateThirdTerm(Object stateInfo)
    {
        double preCalc = randomGenerator.NextDouble();

        manualEvent.WaitOne();
        thirdTerm = preCalc * baseNumber * randomGenerator.NextDouble();
        autoEvents[2].Set();
    } //CalculateThirdTerm

    public double Result(int seed)
    {
        randomGenerator = new Random(seed);

        // Simultaneously calculate the terms.
        ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateBase));
        ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateFirstTerm));
        ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateSecondTerm));
        ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateThirdTerm));

        // Wait for all of the terms to be calculated.
        WaitHandle.WaitAll(autoEvents);

        // Reset the wait handle for the next calculation.
        manualEvent.Reset();
        return firstTerm + secondTerm + thirdTerm;
    } //Result
} //Calculate
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.Threading.WaitHandle
       System.Threading.EventWaitHandle
        System.Threading.AutoResetEvent
スレッド セーフスレッド セーフ

このクラスは、スレッド セーフです。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AutoResetEvent コンストラクタ

初期状態をシグナル状態に設定するかどうかを示す Boolean 型の値を使用して、AutoResetEvent クラスの新しいインスタンスを初期化します。

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    initialState As Boolean _
)
Dim initialState As Boolean

Dim instance As New AutoResetEvent(initialState)
public AutoResetEvent (
    bool initialState
)
public:
AutoResetEvent (
    bool initialState
)
public AutoResetEvent (
    boolean initialState
)
public function AutoResetEvent (
    initialState : boolean
)

パラメータ

initialState

初期状態をシグナル状態に設定する場合は true。初期状態を非シグナル状態に設定する場合は false。

使用例使用例
Imports System
Imports System.Threading

Namespace AutoResetEvent_Examples
    Class MyMainClass
        'Initially not signaled.
        Private Const numIterations As
 Integer = 100
        Private Shared myResetEvent As
 New AutoResetEvent(False)
        Private Shared number As
 Integer

        <MTAThread> _
        Shared Sub Main()
            'Create and start the reader thread.
            Dim myReaderThread As New
 Thread(AddressOf MyReadThreadProc)
            myReaderThread.Name = "ReaderThread"
            myReaderThread.Start()

            Dim i As Integer
            For i = 1 To numIterations
                Console.WriteLine("Writer thread writing value:
 {0}", i)
                number = i

                'Signal that a value has been written.
                myResetEvent.Set()

                'Give the Reader thread an opportunity to act.
                Thread.Sleep(0)
            Next i

            'Terminate the reader thread.
            myReaderThread.Abort()
        End Sub 'Main

        Shared Sub MyReadThreadProc()
            While True
                'The value will not be read until the writer has written
                ' at least once since the last read.
                myResetEvent.WaitOne()
                Console.WriteLine("{0} reading value: {1}",
 Thread.CurrentThread.Name, number)
            End While
        End Sub 'MyReadThreadProc
    End Class 'MyMainClass
End Namespace 'AutoResetEvent_Examples
using System;
using System.Threading;

namespace AutoResetEvent_Examples
{
    class MyMainClass
    {
        //Initially not signaled.
      const int numIterations = 100;
      static AutoResetEvent myResetEvent = new
 AutoResetEvent(false);
      static int number;
      
      static void Main()
        {
         //Create and start the reader thread.
         Thread myReaderThread = new Thread(new
 ThreadStart(MyReadThreadProc));
         myReaderThread.Name = "ReaderThread";
         myReaderThread.Start();

         for(int i = 1; i <= numIterations;
 i++)
         {
            Console.WriteLine("Writer thread writing value: {0}", i);
            number = i;
            
            //Signal that a value has been written.
            myResetEvent.Set();
            
            //Give the Reader thread an opportunity to act.
            Thread.Sleep(0);
         }

         //Terminate the reader thread.
         myReaderThread.Abort();
      }

      static void MyReadThreadProc()
      {
         while(true)
         {
            //The value will not be read until the writer has written
            // at least once since the last read.
            myResetEvent.WaitOne();
            Console.WriteLine("{0} reading value: {1}", Thread.CurrentThread.Name,
 number);
         }
      }
    }
}
using namespace System;
using namespace System::Threading;
ref class MyMainClass
{
public:
   static void MyReadThreadProc()
   {
      while ( true )
      {
         
         //The value will not be read until the writer has written
         // at least once since the last read.
         myResetEvent->WaitOne();
         Console::WriteLine( " {0} reading value: {1}", Thread::CurrentThread->Name,
 number );
      }
   }


   //Initially not signaled.
   static AutoResetEvent^ myResetEvent = gcnew AutoResetEvent(
 false );
   static int number;
   literal int numIterations = 100;
};

int main()
{
   
   //Create and start the reader thread.
   Thread^ myReaderThread = gcnew Thread( gcnew ThreadStart( MyMainClass::MyReadThreadProc
 ) );
   myReaderThread->Name = "ReaderThread";
   myReaderThread->Start();
   for ( int i = 1; i <= MyMainClass::numIterations;
 i++ )
   {
      Console::WriteLine( "Writer thread writing value: {0}", i );
      MyMainClass::number = i;
      
      //Signal that a value has been written.
      MyMainClass::myResetEvent->Set();
      
      //Give the Reader thread an opportunity to act.
      Thread::Sleep( 0 );

   }
   
   //Terminate the reader thread.
   myReaderThread->Abort();
}

package AutoResetEvent_Examples;

import System.*;
import System.Threading.*;
import System.Threading.Thread;

class MyMainClass
{
    //Initially not signaled.
    private final static int
 numIterations = 100;
    private static AutoResetEvent myResetEvent
 = new AutoResetEvent(false);
    private static int number;

    public static void main(String[]
 args)
    {
        //Create and start the reader thread.
        Thread myReaderThread = new Thread(new
 ThreadStart(MyReadThreadProc));
        myReaderThread.set_Name("ReaderThread");
        myReaderThread.Start();
        for (int i = 1; i <= numIterations;
 i++) {
            Console.WriteLine("Writer thread writing value: {0}",
                String.valueOf(i));
            number = i;

            //Signal that a value has been written.
            myResetEvent.Set();

            //Give the Reader thread an opportunity to act.
            Thread.Sleep(0);
        }

        //Terminate the reader thread.
        myReaderThread.Abort();
    } //main

    static void MyReadThreadProc()
    {
        while (true) {
            //The value will not be read until the writer has written
            // at least once since the last read.
            myResetEvent.WaitOne();
            Console.WriteLine("{0} reading value: {1}", 
                Thread.get_CurrentThread().get_Name(),String.valueOf(number));
        }
    } //MyReadThreadProc
} //MyMainClass
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AutoResetEvent プロパティ


AutoResetEvent メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド Close  派生クラスでオーバーライドされると、現在の WaitHandle で保持されているすべてのリソースを解放します。 ( WaitHandle から継承されます。)
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド GetAccessControl  現在の EventWaitHandle オブジェクトによって表される名前付きシステム イベントのアクセス制御セキュリティを表す EventWaitHandleSecurity オブジェクトを取得します。 ( EventWaitHandle から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド OpenExisting  オーバーロードされます。 既存の名前付き同期イベントを開きます。 ( EventWaitHandle から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド Reset  イベントの状態を非シグナル状態に設定し、スレッドをブロックします。 ( EventWaitHandle から継承されます。)
パブリック メソッド Set  イベントの状態をシグナル状態に設定し、待機している 1 つ以上のスレッドが進行できるようにします。 ( EventWaitHandle から継承されます。)
パブリック メソッド SetAccessControl  名前付きシステム イベントのアクセス制御セキュリティを設定します。 ( EventWaitHandle から継承されます。)
パブリック メソッド SignalAndWait  オーバーロードされます。 分割不可能な操作として、1 つの WaitHandle を通知し、別の WaitHandle を待機します。 ( WaitHandle から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
パブリック メソッド WaitAll  オーバーロードされます。 指定した配列内のすべての要素がシグナルを受信するまで待機します。 ( WaitHandle から継承されます。)
パブリック メソッド WaitAny  オーバーロードされます。 指定した配列内のいずれかの要素がシグナルを受信するまで待機します。 ( WaitHandle から継承されます。)
パブリック メソッド WaitOne  オーバーロードされます。 派生クラスでオーバーライドされると、現在の WaitHandle がシグナルを受信するまで現在のスレッドをブロックします。 ( WaitHandle から継承されます。)
参照参照

関連項目

AutoResetEvent クラス
System.Threading 名前空間
WaitHandle

その他の技術情報

マネージ スレッド処理
AutoResetEvent

AutoResetEvent メンバ

イベントが発生したことを待機中のスレッドに通知します。このクラスは継承できません。

AutoResetEvent データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド Close  派生クラスでオーバーライドされると、現在の WaitHandle で保持されているすべてのリソースを解放します。 (WaitHandle から継承されます。)
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド GetAccessControl  現在の EventWaitHandle オブジェクトによって表される名前付きシステム イベントのアクセス制御セキュリティを表す EventWaitHandleSecurity オブジェクトを取得します。 (EventWaitHandle から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド OpenExisting  オーバーロードされます。 既存の名前付き同期イベントを開きます。 (EventWaitHandle から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド Reset  イベントの状態を非シグナル状態に設定し、スレッドをブロックします。 (EventWaitHandle から継承されます。)
パブリック メソッド Set  イベントの状態をシグナル状態に設定し、待機している 1 つ以上のスレッドが進行できるようにします。 (EventWaitHandle から継承されます。)
パブリック メソッド SetAccessControl  名前付きシステム イベントのアクセス制御セキュリティを設定します。 (EventWaitHandle から継承されます。)
パブリック メソッド SignalAndWait  オーバーロードされます。 分割不可能な操作として、1 つの WaitHandle を通知し、別の WaitHandle を待機します。 (WaitHandle から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
パブリック メソッド WaitAll  オーバーロードされます。 指定した配列内のすべての要素がシグナルを受信するまで待機します。 (WaitHandle から継承されます。)
パブリック メソッド WaitAny  オーバーロードされます。 指定した配列内のいずれかの要素がシグナルを受信するまで待機します。 (WaitHandle から継承されます。)
パブリック メソッド WaitOne  オーバーロードされます。 派生クラスでオーバーライドされると、現在の WaitHandle がシグナルを受信するまで現在のスレッドをブロックします。 (WaitHandle から継承されます。)
参照参照

関連項目

AutoResetEvent クラス
System.Threading 名前空間
WaitHandle

その他の技術情報

マネージ スレッド処理
AutoResetEvent



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「AutoResetEvent」の関連用語

AutoResetEventのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AutoResetEventのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS