1
0

STPEventWaitHandle.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #if !(_WINDOWS_CE)
  2. using System;
  3. using System.Threading;
  4. namespace Amib.Threading.Internal
  5. {
  6. #if _WINDOWS || WINDOWS_PHONE
  7. internal static class STPEventWaitHandle
  8. {
  9. public const int WaitTimeout = Timeout.Infinite;
  10. internal static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
  11. {
  12. return WaitHandle.WaitAll(waitHandles, millisecondsTimeout);
  13. }
  14. internal static int WaitAny(WaitHandle[] waitHandles)
  15. {
  16. return WaitHandle.WaitAny(waitHandles);
  17. }
  18. internal static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
  19. {
  20. return WaitHandle.WaitAny(waitHandles, millisecondsTimeout);
  21. }
  22. internal static bool WaitOne(WaitHandle waitHandle, int millisecondsTimeout, bool exitContext)
  23. {
  24. return waitHandle.WaitOne(millisecondsTimeout);
  25. }
  26. }
  27. #else
  28. internal static class STPEventWaitHandle
  29. {
  30. public const int WaitTimeout = Timeout.Infinite;
  31. internal static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
  32. {
  33. return WaitHandle.WaitAll(waitHandles, millisecondsTimeout, exitContext);
  34. }
  35. internal static int WaitAny(WaitHandle[] waitHandles)
  36. {
  37. return WaitHandle.WaitAny(waitHandles);
  38. }
  39. internal static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
  40. {
  41. return WaitHandle.WaitAny(waitHandles, millisecondsTimeout, exitContext);
  42. }
  43. internal static bool WaitOne(WaitHandle waitHandle, int millisecondsTimeout, bool exitContext)
  44. {
  45. return waitHandle.WaitOne(millisecondsTimeout, exitContext);
  46. }
  47. }
  48. #endif
  49. }
  50. #endif