JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Suspending Threads

To suspend a thread's execution, you can use the thread's Suspend method:


This just stops the thread's execution until you use the Resume method (see "Resuming Threads" coming up next).

For example, we used the Suspend method in the Threading example discussed in the In Depth section of this chapter; this method was called when the user clicks the "Suspend Counting" button in that example (you can see this example at work in Figure 24.10):

    Dim Thread1 As New System.Threading.Thread(AddressOf counter1.Count)
    Private Sub Button5_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button5.Click
    End Sub

For more on how this example works, take a look at the discussion in the In Depth section of this chapter.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor