diff options
Diffstat (limited to 'vb/demo/Ice/async/WorkQueue.vb')
-rwxr-xr-x | vb/demo/Ice/async/WorkQueue.vb | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/vb/demo/Ice/async/WorkQueue.vb b/vb/demo/Ice/async/WorkQueue.vb index 7114e0fe822..d42d099ebb1 100755 --- a/vb/demo/Ice/async/WorkQueue.vb +++ b/vb/demo/Ice/async/WorkQueue.vb @@ -16,7 +16,7 @@ Public Class WorkQueue Private Class CallbackEntry Public cb As AMD_Hello_sayHello - Public delay As Integer + Public delay As Integer End Class Public Sub Join() @@ -25,57 +25,57 @@ Public Class WorkQueue Public Sub Start() _thread = New Thread(New ThreadStart(AddressOf Me.Run)) - _thread.Start() + _thread.Start() End Sub Public Sub Run() SyncLock Me - While Not _done - If _callbacks.Count = 0 Then - Monitor.Wait(Me) - End If + While Not _done + If _callbacks.Count = 0 Then + Monitor.Wait(Me) + End If - If Not _callbacks.Count = 0 Then - Dim entry As CallbackEntry = _callbacks(0) - Monitor.Wait(Me, entry.delay) + If Not _callbacks.Count = 0 Then + Dim entry As CallbackEntry = _callbacks(0) + Monitor.Wait(Me, entry.delay) - If Not _done Then - _callbacks.RemoveAt(0) - Console.WriteLine("Belated Hello World!") - entry.cb.ice_response() - End If - End If - End While + If Not _done Then + _callbacks.RemoveAt(0) + Console.WriteLine("Belated Hello World!") + entry.cb.ice_response() + End If + End If + End While - Dim e As CallbackEntry - For Each e In _callbacks - e.cb.ice_exception(New RequestCanceledException()) - Next - End SyncLock + Dim e As CallbackEntry + For Each e In _callbacks + e.cb.ice_exception(New RequestCanceledException()) + Next + End SyncLock End Sub Public Sub Add(ByVal cb As AMD_Hello_sayHello, ByVal delay As Integer) SyncLock Me - If Not _done Then - Dim entry As CallbackEntry = New CallbackEntry - entry.cb = cb - entry.delay = delay + If Not _done Then + Dim entry As CallbackEntry = New CallbackEntry + entry.cb = cb + entry.delay = delay - If _callbacks.Count = 0 Then - Monitor.Pulse(Me) - End If - _callbacks.Add(entry) - Else - cb.ice_exception(New RequestCanceledException()) - End If - End SyncLock + If _callbacks.Count = 0 Then + Monitor.Pulse(Me) + End If + _callbacks.Add(entry) + Else + cb.ice_exception(New RequestCanceledException()) + End If + End SyncLock End Sub Public Sub destroy() SyncLock Me - _done = True - Monitor.Pulse(Me) - End SyncLock + _done = True + Monitor.Pulse(Me) + End SyncLock End Sub Private _thread As Thread |