WaitHandle.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // System.Threading.WaitHandle.cs
  3. //
  4. // Author:
  5. // Dick Porter ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. namespace System.Threading
  10. {
  11. public abstract class WaitHandle : MarshalByRefObject, IDisposable
  12. {
  13. public static bool WaitAll(WaitHandle[] waitHandles) {
  14. // FIXME
  15. return(false);
  16. }
  17. public static bool WaitAll(WaitHandle[] waitHandles,
  18. int millisecondsTimeout,
  19. bool exitContext) {
  20. // FIXME
  21. return(false);
  22. }
  23. public static bool WaitAll(WaitHandle[] waitHandles,
  24. TimeSpan timeout,
  25. bool exitContext) {
  26. // FIXME
  27. return(false);
  28. }
  29. public static int WaitAny(WaitHandle[] waitHandles) {
  30. // FIXME
  31. return(0);
  32. }
  33. public static int WaitAny(WaitHandle[] waitHandles,
  34. int millisecondsTimeout,
  35. bool exitContext) {
  36. // FIXME
  37. return(0);
  38. }
  39. public static int WaitAny(WaitHandle[] waitHandles,
  40. TimeSpan timeout, bool exitContext) {
  41. if(timeout.Milliseconds < 0 ||
  42. timeout.Milliseconds > Int32.MaxValue) {
  43. throw new ArgumentOutOfRangeException("Timeout out of range");
  44. }
  45. // FIXME
  46. return(0);
  47. }
  48. public WaitHandle() {
  49. // FIXME
  50. }
  51. public virtual IntPtr Handle {
  52. get {
  53. // FIXME
  54. return new IntPtr();
  55. }
  56. set {
  57. // FIXME
  58. }
  59. }
  60. public virtual void Close() {
  61. Dispose(false);
  62. }
  63. protected static readonly IntPtr InvalidHandle;
  64. private bool disposed = false;
  65. public void Dispose() {
  66. Dispose(true);
  67. // Take yourself off the Finalization queue
  68. GC.SuppressFinalize(this);
  69. }
  70. protected virtual void Dispose(bool explicitDisposing) {
  71. // Check to see if Dispose has already been called.
  72. if(!this.disposed) {
  73. // If this is a call to Dispose,
  74. // dispose all managed resources.
  75. if(explicitDisposing) {
  76. // Free up stuff here
  77. //Components.Dispose();
  78. }
  79. // Release unmanaged resources
  80. // Note that this is not thread safe.
  81. // Another thread could start
  82. // disposing the object after the
  83. // managed resources are disposed, but
  84. // before the disposed flag is set to
  85. // true.
  86. this.disposed=true;
  87. //Release(handle);
  88. //handle=IntPtr.Zero;
  89. }
  90. }
  91. ~WaitHandle() {
  92. Dispose(false);
  93. }
  94. }
  95. }