Ignore:
Timestamp:
Aug 20, 2008, 3:37:44 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

ThreadPoolの実装、WaitHandle.WaitAny/WaitAllのまともな実装、ほか。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Threading/EventWaitHandle.ab

    r494 r599  
    1111Class EventWaitHandle
    1212    Inherits System.Threading.WaitHandle
    13 
     13Private
     14    Sub EventWaitHandle()
     15    End Sub
    1416Public
    1517    Sub EventWaitHandle (initialState As Boolean, mode As EventResetMode)
     
    5456    既存の名前付き同期イベントを開きます。
    5557    */
    56     Static Function OpenExisting(name As String) As WaitHandle
    57         This.Handle(OpenEvent(EVENT_ALL_ACCESS,FALSE,ToTCStr(name)))
     58    Static Function OpenExisting(name As String) As EventWaitHandle
     59        If ActiveBasic.IsNothing(name) Then
     60            Throw New ArgumentNullException("name")
     61        Else If name.Length = 0 Then
     62            Throw New ArgumentException("name")
     63        End If
     64        OpenExisting = New EventWaitHandle
     65        Dim h = OpenEvent(EVENT_ALL_ACCESS, FALSE, ToTCStr(name))
     66        If h = 0 Then
     67            IO.Detail.ThrowWinLastErrorIOException("OpenEvent failed.")
     68        End If
     69        OpenExisting.Handle = h
    5870    End Function
    5971
     
    95107WaitHandle から継承
    96108Handle
    97 SafeWaitHandle 
     109SafeWaitHandle
    98110*/
    99111
Note: See TracChangeset for help on using the changeset viewer.