source: trunk/Include/Classes/System/Threading/EventWaitHandle.ab@ 419

Last change on this file since 419 was 419, checked in by NoWest, 16 years ago

この際なのでWaitHandle系を全部実装

File size: 2.4 KB
RevLine 
[419]1' Classes/System/Threading/EventWaitHandle.ab
[417]2
[419]3#ifndef __SYSTEM_THREADING_EVENTWAITHANDLE_AB__
4#define __SYSTEM_THREADING_EVENTWAITHANDLE_AB__
5
[417]6NameSpace System
7NameSpace Threading
8
9Enum EventResetMode
10 AutoReset = False
11 ManualReset = True
12End Enum
13
14Class EventWaitHandle
15 Inherits System.Threading.WaitHandle
16
17Public
18 Sub EventWaitHandle (initialState As Boolean, mode As EventResetMode)
[419]19 This.Handle(CreateEvent(NULL,mode As BOOL,initialState As BOOL,NULL))
[417]20 End Sub
21 Sub EventWaitHandle (initialState As Boolean, mode As EventResetMode, name As String)
[419]22 This.Handle(CreateEvent(NULL,mode As BOOL,initialState As BOOL,ToTCStr(name)))
[417]23 End Sub
24 Sub EventWaitHandle (initialState As Boolean, mode As EventResetMode, name As String, ByRef createdNew As Boolean)
[419]25 This.Handle(CreateEvent(NULL,mode As BOOL,initialState As BOOL,ToTCStr(name)))
26 If ERROR_ALREADY_EXISTS=GetLastError() Then createdNew=False Else createdNew=True
[417]27 End Sub
28/* Sub EventWaitHandle (initialState As Boolean, mode As EventResetMode, name As String, ByRef createdNew As Boolean, EventWaitHandleSecurity)
29 TODO
30 End Sub*/
31
32/*
33WaitHandle で保持されているすべてのリソースを解放します。
34WaitHandleから継承
35Virtual Sub Close()
36End Sub
37*/
38
39/*CreateObjRef*/
40
41/*
42WaitHandleから継承
43 Virtual Sub Dispose()
44 End Sub
45*/
46
47/*Equals*/
48/*Finalize*/
49/*GetAccessControl*/
50/*GetHashCode*/
51/*GetLifetimeService*/
52/*InitializeLifetimeService*/
53/*MemberwiseClone*/
54
55
56 /*
57 既存の名前付き同期イベントを開きます。
58 */
59 Static Function OpenExisting(name As String) As WaitHandle
[419]60 This.Handle(OpenEvent(EVENT_ALL_ACCESS,FALSE,ToTCStr(name)))
[417]61 End Function
62
63 /*
64 セキリティアクセスを指定して既存の名前付き同期イベントを開きます。
65 */
66/* Static Function OpenExisting(name As String, rights As EventWaitHandleRights) As WaitHandle
67 TODO
68 End Function*/
69
70 /*
71 イベントの状態を非シグナル状態に設定し、スレッドをブロックします。
72 */
73 Function Reset() As Boolean
74 If ResetEvent(This.Handle()) Then Return True
75 Reset=False
76 End Function
77
78
79 /*
80 イベントの状態をシグナル状態に設定し、待機している 1 つ以上のスレッドが進行できるようにします。
81 */
82 Function Set() As Boolean
83 If SetEvent(This.Handle()) Then Return True
84 Set=False
85 End Function
86
87/*SetAccessControl*/
88/*ToString*/
89
90/*
91WaitHandleから継承
92WaitAll
93WaitAny
94WaitOne
95*/
96
97/*
98WaitHandle から継承
99Handle
100SafeWaitHandle
101*/
102
103End Class
104
105End Namespace
[419]106End Namespace
107
108#endif
Note: See TracBrowser for help on using the repository browser.