EventWaitHandle EventWaitHandle EventWaitHandle EventWaitHandle Class

정의

스레드 동기화 이벤트를 나타냅니다.Represents a thread synchronization event.

public ref class EventWaitHandle : System::Threading::WaitHandle
[System.Runtime.InteropServices.ComVisible(true)]
public class EventWaitHandle : System.Threading.WaitHandle
type EventWaitHandle = class
    inherit WaitHandle
Public Class EventWaitHandle
Inherits WaitHandle
상속
특성

예제

다음 코드 예제에서는 SignalAndWait(WaitHandle, WaitHandle) 메서드 오버 로드는 주 스레드가 차단 된 스레드가 신호를 보내고 스레드가 작업을 완료할 때까지 대기할 수 있도록 합니다.The following code example uses the SignalAndWait(WaitHandle, WaitHandle) method overload to allow the main thread to signal a blocked thread and then wait until the thread finishes a task.

이 예제에서는 5 개의 스레드를 시작 하 고에서 차단 될 수 있습니다는 EventWaitHandle 사용 하 여 만든는 EventResetMode.AutoReset 플래그를 다음 릴리스에서 사용자가 ENTER 키를 누를 때마다 스레드를 하나씩 있습니다.The example starts five threads and allows them to block on an EventWaitHandle created with the EventResetMode.AutoReset flag, then releases one thread each time the user presses the ENTER key. 다음 예제에서는 다른 5 개의 스레드가 큐를 사용 하 여 모든 릴리스 하는 EventWaitHandle 사용 하 여 만든는 EventResetMode.ManualReset 플래그입니다.The example then queues another five threads and releases them all using an EventWaitHandle created with the EventResetMode.ManualReset flag.

using namespace System;
using namespace System::Threading;

public ref class Example
{
private:
   // The EventWaitHandle used to demonstrate the difference
   // between AutoReset and ManualReset synchronization events.
   //
   static EventWaitHandle^ ewh;

   // A counter to make sure all threads are started and
   // blocked before any are released. A Long is used to show
   // the use of the 64-bit Interlocked methods.
   //
   static __int64 threadCount = 0;

   // An AutoReset event that allows the main thread to block
   // until an exiting thread has decremented the count.
   //
   static EventWaitHandle^ clearCount =
      gcnew EventWaitHandle( false,EventResetMode::AutoReset );

public:
   [MTAThread]
   static void main()
   {
      // Create an AutoReset EventWaitHandle.
      //
      ewh = gcnew EventWaitHandle( false,EventResetMode::AutoReset );
      
      // Create and start five numbered threads. Use the
      // ParameterizedThreadStart delegate, so the thread
      // number can be passed as an argument to the Start
      // method.
      for ( int i = 0; i <= 4; i++ )
      {
         Thread^ t = gcnew Thread(
            gcnew ParameterizedThreadStart( ThreadProc ) );
         t->Start( i );
      }
      
      // Wait until all the threads have started and blocked.
      // When multiple threads use a 64-bit value on a 32-bit
      // system, you must access the value through the
      // Interlocked class to guarantee thread safety.
      //
      while ( Interlocked::Read( threadCount ) < 5 )
      {
         Thread::Sleep( 500 );
      }

      // Release one thread each time the user presses ENTER,
      // until all threads have been released.
      //
      while ( Interlocked::Read( threadCount ) > 0 )
      {
         Console::WriteLine( L"Press ENTER to release a waiting thread." );
         Console::ReadLine();
         
         // SignalAndWait signals the EventWaitHandle, which
         // releases exactly one thread before resetting,
         // because it was created with AutoReset mode.
         // SignalAndWait then blocks on clearCount, to
         // allow the signaled thread to decrement the count
         // before looping again.
         //
         WaitHandle::SignalAndWait( ewh, clearCount );
      }
      Console::WriteLine();
      
      // Create a ManualReset EventWaitHandle.
      //
      ewh = gcnew EventWaitHandle( false,EventResetMode::ManualReset );
      
      // Create and start five more numbered threads.
      //
      for ( int i = 0; i <= 4; i++ )
      {
         Thread^ t = gcnew Thread(
            gcnew ParameterizedThreadStart( ThreadProc ) );
         t->Start( i );
      }
      
      // Wait until all the threads have started and blocked.
      //
      while ( Interlocked::Read( threadCount ) < 5 )
      {
         Thread::Sleep( 500 );
      }

      // Because the EventWaitHandle was created with
      // ManualReset mode, signaling it releases all the
      // waiting threads.
      //
      Console::WriteLine( L"Press ENTER to release the waiting threads." );
      Console::ReadLine();
      ewh->Set();

   }

   static void ThreadProc( Object^ data )
   {
      int index = static_cast<Int32>(data);

      Console::WriteLine( L"Thread {0} blocks.", data );
      // Increment the count of blocked threads.
      Interlocked::Increment( threadCount );
      
      // Wait on the EventWaitHandle.
      ewh->WaitOne();

      Console::WriteLine( L"Thread {0} exits.", data );
      // Decrement the count of blocked threads.
      Interlocked::Decrement( threadCount );
      
      // After signaling ewh, the main thread blocks on
      // clearCount until the signaled thread has
      // decremented the count. Signal it now.
      //
      clearCount->Set();
   }
};
using System;
using System.Threading;

public class Example
{
    // The EventWaitHandle used to demonstrate the difference
    // between AutoReset and ManualReset synchronization events.
    //
    private static EventWaitHandle ewh;

    // A counter to make sure all threads are started and
    // blocked before any are released. A Long is used to show
    // the use of the 64-bit Interlocked methods.
    //
    private static long threadCount = 0;

    // An AutoReset event that allows the main thread to block
    // until an exiting thread has decremented the count.
    //
    private static EventWaitHandle clearCount = 
        new EventWaitHandle(false, EventResetMode.AutoReset);

    [MTAThread]
    public static void Main()
    {
        // Create an AutoReset EventWaitHandle.
        //
        ewh = new EventWaitHandle(false, EventResetMode.AutoReset);

        // Create and start five numbered threads. Use the
        // ParameterizedThreadStart delegate, so the thread
        // number can be passed as an argument to the Start 
        // method.
        for (int i = 0; i <= 4; i++)
        {
            Thread t = new Thread(
                new ParameterizedThreadStart(ThreadProc)
            );
            t.Start(i);
        }

        // Wait until all the threads have started and blocked.
        // When multiple threads use a 64-bit value on a 32-bit
        // system, you must access the value through the
        // Interlocked class to guarantee thread safety.
        //
        while (Interlocked.Read(ref threadCount) < 5)
        {
            Thread.Sleep(500);
        }

        // Release one thread each time the user presses ENTER,
        // until all threads have been released.
        //
        while (Interlocked.Read(ref threadCount) > 0)
        {
            Console.WriteLine("Press ENTER to release a waiting thread.");
            Console.ReadLine();

            // SignalAndWait signals the EventWaitHandle, which
            // releases exactly one thread before resetting, 
            // because it was created with AutoReset mode. 
            // SignalAndWait then blocks on clearCount, to 
            // allow the signaled thread to decrement the count
            // before looping again.
            //
            WaitHandle.SignalAndWait(ewh, clearCount);
        }
        Console.WriteLine();

        // Create a ManualReset EventWaitHandle.
        //
        ewh = new EventWaitHandle(false, EventResetMode.ManualReset);

        // Create and start five more numbered threads.
        //
        for(int i=0; i<=4; i++)
        {
            Thread t = new Thread(
                new ParameterizedThreadStart(ThreadProc)
            );
            t.Start(i);
        }

        // Wait until all the threads have started and blocked.
        //
        while (Interlocked.Read(ref threadCount) < 5)
        {
            Thread.Sleep(500);
        }

        // Because the EventWaitHandle was created with
        // ManualReset mode, signaling it releases all the
        // waiting threads.
        //
        Console.WriteLine("Press ENTER to release the waiting threads.");
        Console.ReadLine();
        ewh.Set();
        
    }

    public static void ThreadProc(object data)
    {
        int index = (int) data;

        Console.WriteLine("Thread {0} blocks.", data);
        // Increment the count of blocked threads.
        Interlocked.Increment(ref threadCount);

        // Wait on the EventWaitHandle.
        ewh.WaitOne();

        Console.WriteLine("Thread {0} exits.", data);
        // Decrement the count of blocked threads.
        Interlocked.Decrement(ref threadCount);

        // After signaling ewh, the main thread blocks on
        // clearCount until the signaled thread has 
        // decremented the count. Signal it now.
        //
        clearCount.Set();
    }
}
Imports System.Threading

Public Class Example

    ' The EventWaitHandle used to demonstrate the difference
    ' between AutoReset and ManualReset synchronization events.
    '
    Private Shared ewh As EventWaitHandle

    ' A counter to make sure all threads are started and
    ' blocked before any are released. A Long is used to show
    ' the use of the 64-bit Interlocked methods.
    '
    Private Shared threadCount As Long = 0

    ' An AutoReset event that allows the main thread to block
    ' until an exiting thread has decremented the count.
    '
    Private Shared clearCount As New EventWaitHandle(False, _
        EventResetMode.AutoReset)

    <MTAThread> _
    Public Shared Sub Main()

        ' Create an AutoReset EventWaitHandle.
        '
        ewh = New EventWaitHandle(False, EventResetMode.AutoReset)

        ' Create and start five numbered threads. Use the
        ' ParameterizedThreadStart delegate, so the thread
        ' number can be passed as an argument to the Start 
        ' method.
        For i As Integer = 0 To 4
            Dim t As New Thread(AddressOf ThreadProc)
            t.Start(i)
        Next i

        ' Wait until all the threads have started and blocked.
        ' When multiple threads use a 64-bit value on a 32-bit
        ' system, you must access the value through the
        ' Interlocked class to guarantee thread safety.
        '
        While Interlocked.Read(threadCount) < 5
            Thread.Sleep(500)
        End While

        ' Release one thread each time the user presses ENTER,
        ' until all threads have been released.
        '
        While Interlocked.Read(threadCount) > 0
            Console.WriteLine("Press ENTER to release a waiting thread.")
            Console.ReadLine()

            ' SignalAndWait signals the EventWaitHandle, which
            ' releases exactly one thread before resetting, 
            ' because it was created with AutoReset mode. 
            ' SignalAndWait then blocks on clearCount, to 
            ' allow the signaled thread to decrement the count
            ' before looping again.
            '
            WaitHandle.SignalAndWait(ewh, clearCount)
        End While
        Console.WriteLine()

        ' Create a ManualReset EventWaitHandle.
        '
        ewh = New EventWaitHandle(False, EventResetMode.ManualReset)

        ' Create and start five more numbered threads.
        '
        For i As Integer = 0 To 4
            Dim t As New Thread(AddressOf ThreadProc)
            t.Start(i)
        Next i

        ' Wait until all the threads have started and blocked.
        '
        While Interlocked.Read(threadCount) < 5
            Thread.Sleep(500)
        End While

        ' Because the EventWaitHandle was created with
        ' ManualReset mode, signaling it releases all the
        ' waiting threads.
        '
        Console.WriteLine("Press ENTER to release the waiting threads.")
        Console.ReadLine()
        ewh.Set()
        
    End Sub

    Public Shared Sub ThreadProc(ByVal data As Object)
        Dim index As Integer = CInt(data)

        Console.WriteLine("Thread {0} blocks.", data)
        ' Increment the count of blocked threads.
        Interlocked.Increment(threadCount)

        ' Wait on the EventWaitHandle.
        ewh.WaitOne()

        Console.WriteLine("Thread {0} exits.", data)
        ' Decrement the count of blocked threads.
        Interlocked.Decrement(threadCount)

        ' After signaling ewh, the main thread blocks on
        ' clearCount until the signaled thread has 
        ' decremented the count. Signal it now.
        '
        clearCount.Set()
    End Sub
End Class

설명

EventWaitHandle 클래스를 사용 하면 스레드가 신호를 보내 서로 통신할 수 있습니다.The EventWaitHandle class allows threads to communicate with each other by signaling. 하나 이상의 스레드가 차단 되는 일반적으로 EventWaitHandle 스레드를 차단 해제 호출 될 때까지 Set 메서드를 하나 이상의 차단 된 스레드를 해제 합니다.Typically, one or more threads block on an EventWaitHandle until an unblocked thread calls the Set method, releasing one or more of the blocked threads. 스레드 되었음을 알릴 수는 EventWaitHandle 를 호출 하 여 다음 차단 합니다 static (Shared Visual Basic의) WaitHandle.SignalAndWait 메서드.A thread can signal an EventWaitHandle and then block on it, by calling the static (Shared in Visual Basic) WaitHandle.SignalAndWait method.

참고

EventWaitHandle 클래스는 명명 된 시스템 동기화 이벤트에 대 한 액세스를 제공 합니다.The EventWaitHandle class provides access to named system synchronization events.

동작을 EventWaitHandle 신호를 받은 다시 설정 모드에 따라 달라 집니다.The behavior of an EventWaitHandle that has been signaled depends on its reset mode. EventWaitHandle 사용 하 여 만든는 EventResetMode.AutoReset 플래그는 단일 대기 스레드를 해제 한 후 신호를 받을 때 자동으로 재설정 합니다.An EventWaitHandle created with the EventResetMode.AutoReset flag resets automatically when signaled, after releasing a single waiting thread. EventResetMode.ManualReset 플래그를 사용하여 만들어진 EventWaitHandleReset 메서드가 호출될 때까지 신호 알림 상태를 유지합니다.An EventWaitHandle created with the EventResetMode.ManualReset flag remains signaled until its Reset method is called.

자동 재설정 이벤트는 리소스에 대 한 단독 액세스를 제공합니다.Automatic reset events provide exclusive access to a resource. 대기 중인 스레드가 없을 때 신호를 받은 자동 재설정 이벤트는 스레드가 이 이벤트에서 대기를 시도할 때까지 신호를 받은 것으로 유지됩니다.If an automatic reset event is signaled when no threads are waiting, it remains signaled until a thread attempts to wait on it. 이벤트는 스레드를 해제하고 즉시 다시 설정되어 후속 스레드를 차단합니다.The event releases the thread and immediately resets, blocking subsequent threads.

수동 재설정 이벤트는 출입문과 비슷합니다.Manual reset events are like gates. 이벤트 신호를 받지 대기 중인 스레드가 차단 됩니다.When the event is not signaled, threads that wait on it will block. 이벤트가 신호를 모든 대기 스레드가 해제 되 고, 이벤트 신호를 받은 상태로 유지 됩니다 하는 경우 (즉, 후속 대기를 차단 하지 않습니다) 될 때까지 해당 Reset 메서드가 호출 됩니다.When the event is signaled, all waiting threads are released, and the event remains signaled (that is, subsequent waits do not block) until its Reset method is called. 수동 재설정 이벤트는 하나의 스레드가 다른 스레드에서 진행 되기 전에 작업을 완료 해야 하는 경우에 유용 합니다.Manual reset events are useful when one thread must complete an activity before other threads can proceed.

EventWaitHandle 개체를 사용 하 여 사용할 수는 static(Shared Visual basic에서) WaitHandle.WaitAllWaitHandle.WaitAny 메서드.EventWaitHandle objects can be used with the static(Shared in Visual Basic) WaitHandle.WaitAll and WaitHandle.WaitAny methods.

자세한 내용은 동기화 기본 형식 개요 문서의 스레드 상호 작용 또는 신호 섹션을 참조 하세요.For more information, see the Thread interaction, or signaling section of the Overview of synchronization primitives article.

생성자

EventWaitHandle(Boolean, EventResetMode) EventWaitHandle(Boolean, EventResetMode) EventWaitHandle(Boolean, EventResetMode) EventWaitHandle(Boolean, EventResetMode)

대기 핸들의 초기 상태를 신호 받음으로 설정할지 여부와 대기 핸들을 자동으로 다시 설정할지 수동으로 다시 설정할지 여부를 지정하여 EventWaitHandle 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the EventWaitHandle class, specifying whether the wait handle is initially signaled, and whether it resets automatically or manually.

EventWaitHandle(Boolean, EventResetMode, String) EventWaitHandle(Boolean, EventResetMode, String) EventWaitHandle(Boolean, EventResetMode, String) EventWaitHandle(Boolean, EventResetMode, String)

이 호출의 결과로 만들어진 대기 핸들의 초기 상태를 신호 받음으로 설정할지 여부, 대기 핸들을 자동으로 다시 설정할지 수동으로 다시 설정할지 여부 및 시스템 동기화 이벤트의 이름을 지정하여 EventWaitHandle 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the EventWaitHandle class, specifying whether the wait handle is initially signaled if created as a result of this call, whether it resets automatically or manually, and the name of a system synchronization event.

EventWaitHandle(Boolean, EventResetMode, String, Boolean) EventWaitHandle(Boolean, EventResetMode, String, Boolean) EventWaitHandle(Boolean, EventResetMode, String, Boolean) EventWaitHandle(Boolean, EventResetMode, String, Boolean)

이 호출의 결과로 대기 핸들이 초기에 신호를 받는지 여부, 자동으로 재설정되는지 또는 수동으로 재설정되는지, 시스템 동기화 이벤트의 이름, 호출 후에 해당 값이 명명된 시스템 이벤트가 생성되었는지 여부를 나타내는 부울 변수를 지정하여 EventWaitHandle 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the EventWaitHandle class, specifying whether the wait handle is initially signaled if created as a result of this call, whether it resets automatically or manually, the name of a system synchronization event, and a Boolean variable whose value after the call indicates whether the named system event was created.

EventWaitHandle(Boolean, EventResetMode, String, Boolean, EventWaitHandleSecurity) EventWaitHandle(Boolean, EventResetMode, String, Boolean, EventWaitHandleSecurity) EventWaitHandle(Boolean, EventResetMode, String, Boolean, EventWaitHandleSecurity) EventWaitHandle(Boolean, EventResetMode, String, Boolean, EventWaitHandleSecurity)

이 호출의 결과로 대기 핸들이 초기에 신호를 받는지 여부, 자동으로 재설정되는지 또는 수동으로 재설정되는지, 시스템 동기화 이벤트의 이름, 호출 후에 해당 값이 명명된 시스템 이벤트가 생성되었는지 여부를 나타내는 부울 변수, 생성되는 경우 명명된 이벤트에 적용될 액세스 제어 보안을 지정하여 EventWaitHandle 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the EventWaitHandle class, specifying whether the wait handle is initially signaled if created as a result of this call, whether it resets automatically or manually, the name of a system synchronization event, a Boolean variable whose value after the call indicates whether the named system event was created, and the access control security to be applied to the named event if it is created.

메서드

Close() Close() Close() Close()

현재 WaitHandle에서 보유한 모든 리소스를 해제합니다.Releases all resources held by the current WaitHandle.

(Inherited from WaitHandle)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

WaitHandle 클래스의 현재 인스턴스에서 사용하는 모든 리소스를 해제합니다.Releases all resources used by the current instance of the WaitHandle class.

(Inherited from WaitHandle)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

파생 클래스에서 재정의된 경우 WaitHandle에서 사용하는 관리되지 않는 리소스를 해제하고 필요에 따라 관리되는 리소스를 해제합니다.When overridden in a derived class, releases the unmanaged resources used by the WaitHandle, and optionally releases the managed resources.

(Inherited from WaitHandle)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAccessControl() GetAccessControl() GetAccessControl() GetAccessControl()

현재 EventWaitHandleSecurity 개체로 표시되는 명명된 시스템 이벤트에 대한 액세스 제어 보안을 나타내는 EventWaitHandle 개체를 가져옵니다.Gets an EventWaitHandleSecurity object that represents the access control security for the named system event represented by the current EventWaitHandle object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OpenExisting(String) OpenExisting(String) OpenExisting(String) OpenExisting(String)

이미 있는 경우 지정한 명명된 동기화 이벤트를 엽니다.Opens the specified named synchronization event, if it already exists.

OpenExisting(String, EventWaitHandleRights) OpenExisting(String, EventWaitHandleRights) OpenExisting(String, EventWaitHandleRights) OpenExisting(String, EventWaitHandleRights)

이미 있는 경우 지정한 명명된 동기화 이벤트를 원하는 보안 액세스로 엽니다.Opens the specified named synchronization event, if it already exists, with the desired security access.

Reset() Reset() Reset() Reset()

스레드가 차단되도록 이벤트 상태를 신호 없음으로 설정합니다.Sets the state of the event to nonsignaled, causing threads to block.

Set() Set() Set() Set()

하나 이상의 대기 중인 스레드가 계속 진행되도록 이벤트 상태를 신호 받음으로 설정합니다.Sets the state of the event to signaled, allowing one or more waiting threads to proceed.

SetAccessControl(EventWaitHandleSecurity) SetAccessControl(EventWaitHandleSecurity) SetAccessControl(EventWaitHandleSecurity) SetAccessControl(EventWaitHandleSecurity)

명명된 시스템 이벤트에 대한 액세스 제어 보안을 설정합니다.Sets the access control security for a named system event.

ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)
TryOpenExisting(String, EventWaitHandle) TryOpenExisting(String, EventWaitHandle) TryOpenExisting(String, EventWaitHandle) TryOpenExisting(String, EventWaitHandle)

지정한 명명된 동기화 이벤트(이미 존재하는 경우)를 열고 작업이 성공했는지를 나타내는 값을 반환합니다.Opens the specified named synchronization event, if it already exists, and returns a value that indicates whether the operation succeeded.

TryOpenExisting(String, EventWaitHandleRights, EventWaitHandle) TryOpenExisting(String, EventWaitHandleRights, EventWaitHandle) TryOpenExisting(String, EventWaitHandleRights, EventWaitHandle) TryOpenExisting(String, EventWaitHandleRights, EventWaitHandle)

지정한 명명된 동기화 이벤트(이미 존재하는 경우)를 원하는 보안 액세스로 열고 작업이 성공적으로 수행되었는지 여부를 나타내는 값을 반환합니다.Opens the specified named synchronization event, if it already exists, with the desired security access, and returns a value that indicates whether the operation succeeded.

WaitOne() WaitOne() WaitOne() WaitOne()

현재 WaitHandle이(가) 신호를 받을 때까지 현재 스레드를 차단합니다.Blocks the current thread until the current WaitHandle receives a signal.

(Inherited from WaitHandle)
WaitOne(Int32) WaitOne(Int32) WaitOne(Int32) WaitOne(Int32)

부호 있는 32비트 정수로 시간 간격(밀리초)을 지정하여 현재 WaitHandle이 신호를 받을 때까지 현재 스레드를 차단합니다.Blocks the current thread until the current WaitHandle receives a signal, using a 32-bit signed integer to specify the time interval in milliseconds.

(Inherited from WaitHandle)
WaitOne(Int32, Boolean) WaitOne(Int32, Boolean) WaitOne(Int32, Boolean) WaitOne(Int32, Boolean)

부호 있는 32비트 정수로 시간 간격을 지정하고 대기 전에 동기화 도메인을 끝낼지 여부를 지정하여 현재 WaitHandle이 신호를 받을 때까지 현재 스레드를 차단합니다.Blocks the current thread until the current WaitHandle receives a signal, using a 32-bit signed integer to specify the time interval and specifying whether to exit the synchronization domain before the wait.

(Inherited from WaitHandle)
WaitOne(TimeSpan) WaitOne(TimeSpan) WaitOne(TimeSpan) WaitOne(TimeSpan)

TimeSpan로 시간 간격을 지정하여 현재 인스턴스가 신호를 받을 때까지 현재 스레드를 차단합니다.Blocks the current thread until the current instance receives a signal, using a TimeSpan to specify the time interval.

(Inherited from WaitHandle)
WaitOne(TimeSpan, Boolean) WaitOne(TimeSpan, Boolean) WaitOne(TimeSpan, Boolean) WaitOne(TimeSpan, Boolean)

TimeSpan로 시간 간격을 지정하고 대기 전에 동기화 도메인을 끝낼지 여부를 지정하여 현재 인스턴스가 신호를 받을 때까지 현재 스레드를 차단합니다.Blocks the current thread until the current instance receives a signal, using a TimeSpan to specify the time interval and specifying whether to exit the synchronization domain before the wait.

(Inherited from WaitHandle)

속성

Handle Handle Handle Handle

네이티브 운영 체제 핸들을 가져오거나 설정합니다.Gets or sets the native operating system handle.

(Inherited from WaitHandle)
SafeWaitHandle SafeWaitHandle SafeWaitHandle SafeWaitHandle

네이티브 운영 체제 핸들을 가져오거나 설정합니다.Gets or sets the native operating system handle.

(Inherited from WaitHandle)

명시적 인터페이스 구현

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

WaitHandle에서 사용하는 모든 리소스를 해제합니다.Releases all resources used by the WaitHandle.

(Inherited from WaitHandle)

필드

WaitTimeout WaitTimeout WaitTimeout WaitTimeout

대기 핸들이 신호를 받기 전에 WaitAny(WaitHandle[], Int32, Boolean) 작업이 제한 시간을 초과했음을 나타냅니다.Indicates that a WaitAny(WaitHandle[], Int32, Boolean) operation timed out before any of the wait handles were signaled. 이 필드는 상수입니다.This field is constant.

(Inherited from WaitHandle)

확장 메서드

GetAccessControl(EventWaitHandle) GetAccessControl(EventWaitHandle) GetAccessControl(EventWaitHandle) GetAccessControl(EventWaitHandle)
SetAccessControl(EventWaitHandle, EventWaitHandleSecurity) SetAccessControl(EventWaitHandle, EventWaitHandleSecurity) SetAccessControl(EventWaitHandle, EventWaitHandleSecurity) SetAccessControl(EventWaitHandle, EventWaitHandleSecurity)
GetSafeWaitHandle(WaitHandle) GetSafeWaitHandle(WaitHandle) GetSafeWaitHandle(WaitHandle) GetSafeWaitHandle(WaitHandle)

네이티브 운영 체제 대기 핸들에 대한 안전한 핸들을 가져옵니다.Gets the safe handle for a native operating system wait handle.

SetSafeWaitHandle(WaitHandle, SafeWaitHandle) SetSafeWaitHandle(WaitHandle, SafeWaitHandle) SetSafeWaitHandle(WaitHandle, SafeWaitHandle) SetSafeWaitHandle(WaitHandle, SafeWaitHandle)

네이티브 운영 체제 대기 핸들에 대한 안전한 핸들을 설정합니다.Sets a safe handle for a native operating system wait handle.

적용 대상

스레드 보안

이 형식은 스레드로부터 안전합니다.This type is thread safe.

추가 정보