2003-04-05 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / class / corlib / System.Threading / AutoResetEvent.cs
1 //
2 // System.Threading.AutoResetEvent.cs
3 //
4 // Author:
5 //   Dick Porter (dick@ximian.com)
6 //   Veronica De Santis (veron78@interfree.it)
7 //
8 // (C) Ximian, Inc.  http://www.ximian.com
9 //
10
11 using System;
12 using System.Runtime.CompilerServices;
13
14 namespace System.Threading 
15 {
16
17         public sealed class AutoResetEvent : WaitHandle 
18         {
19                 // Constructor
20                 public AutoResetEvent(bool initialState) {
21                         Handle = NativeEventCalls.CreateEvent_internal(false,initialState,null);
22                 }
23
24                 // Methods
25
26                 public bool Set() {
27                         return(NativeEventCalls.SetEvent_internal(Handle));
28                 }
29
30                 public bool Reset() {
31                         return(NativeEventCalls.ResetEvent_internal(Handle));
32                 }
33
34         }
35 }