ManualResetEvent.cs 674 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // System.Threading.ManualResetEvent.cs
  3. //
  4. // Author:
  5. // Dick Porter ([email protected])
  6. // Veronica De Santis ([email protected])
  7. //
  8. // (C) Ximian, Inc. http://www.ximian.com
  9. //
  10. using System;
  11. using System.Runtime.CompilerServices;
  12. namespace System.Threading
  13. {
  14. public sealed class ManualResetEvent : WaitHandle
  15. {
  16. // Constructor
  17. public ManualResetEvent (bool initialState)
  18. {
  19. Handle = NativeEventCalls.CreateEvent_internal (true, initialState, null);
  20. }
  21. // Methods
  22. public bool Set()
  23. {
  24. return (NativeEventCalls.SetEvent_internal (Handle));
  25. }
  26. public bool Reset()
  27. {
  28. return(NativeEventCalls.ResetEvent_internal (Handle));
  29. }
  30. }
  31. }