impl. MonoAsyncResult
[mono.git] / mcs / class / corlib / System / IAsyncResult.cs
1 //------------------------------------------------------------------------------
2 // 
3 // System.IAsyncResult.cs 
4 //
5 // Copyright (C) 2001 Michael Lambert, All Rights Reserved
6 // 
7 // Author:         Michael Lambert, michaellambert@email.com
8 // Created:        Mon 08/24/2001 
9 //
10 //------------------------------------------------------------------------------
11
12 using System;
13 using System.Threading;
14 using System.Runtime.CompilerServices;
15
16 namespace System {
17
18         public interface IAsyncResult
19         {
20                 object AsyncState
21                 {
22                         get;
23                 }
24
25                 WaitHandle AsyncWaitHandle
26                 {
27                         get;
28                 }
29
30                 bool CompletedSynchronously
31                 {
32                         get;
33                 }
34
35                 bool IsCompleted
36                 {
37                         get;
38                 }
39         }
40
41         internal class MonoAsyncResult : IAsyncResult {
42
43                 object async_state;
44                 WaitHandle handle;
45                 IntPtr data;
46                 bool sync_completed;
47                 bool completed;
48                 
49                 public object AsyncState
50                 {
51                         get {
52                                 return async_state;
53                         }
54                 }
55
56                 public WaitHandle AsyncWaitHandle
57                 {
58                         get {
59                                 return handle;
60                         }
61                 }
62
63                 public bool CompletedSynchronously
64                 {
65                         get {
66                                 return sync_completed;
67                         }
68                 }
69
70                 public bool IsCompleted
71                 {
72                         get {
73                                 return completed;
74                         }
75                 }
76                 
77
78         }
79         
80 } // Namespace System
81
82