[419] | 1 | ' Classes/System/Threading/EventWaitHandle.ab
|
---|
[417] | 2 |
|
---|
[419] | 3 | #ifndef __SYSTEM_THREADING_EVENTWAITHANDLE_AB__
|
---|
| 4 | #define __SYSTEM_THREADING_EVENTWAITHANDLE_AB__
|
---|
| 5 |
|
---|
[417] | 6 | NameSpace System
|
---|
| 7 | NameSpace Threading
|
---|
| 8 |
|
---|
| 9 | Enum EventResetMode
|
---|
| 10 | AutoReset = False
|
---|
| 11 | ManualReset = True
|
---|
| 12 | End Enum
|
---|
| 13 |
|
---|
| 14 | Class EventWaitHandle
|
---|
| 15 | Inherits System.Threading.WaitHandle
|
---|
| 16 |
|
---|
| 17 | Public
|
---|
| 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 | /*
|
---|
| 33 | WaitHandle で保持されているすべてのリソースを解放します。
|
---|
| 34 | WaitHandleから継承
|
---|
| 35 | Virtual Sub Close()
|
---|
| 36 | End Sub
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 39 | /*CreateObjRef*/
|
---|
| 40 |
|
---|
| 41 | /*
|
---|
| 42 | WaitHandleから継承
|
---|
| 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 | /*
|
---|
| 91 | WaitHandleから継承
|
---|
| 92 | WaitAll
|
---|
| 93 | WaitAny
|
---|
| 94 | WaitOne
|
---|
| 95 | */
|
---|
| 96 |
|
---|
| 97 | /*
|
---|
| 98 | WaitHandle から継承
|
---|
| 99 | Handle
|
---|
| 100 | SafeWaitHandle
|
---|
| 101 | */
|
---|
| 102 |
|
---|
| 103 | End Class
|
---|
| 104 |
|
---|
| 105 | End Namespace
|
---|
[419] | 106 | End Namespace
|
---|
| 107 |
|
---|
| 108 | #endif
|
---|