O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What Else Can Be Done to a Thread?

You can interrupt a thread, suspend a thread, resume a thread, and abort a thread. Figure 11.3 shows an application running whereby all these operations are interacting. The full source to this application is available in the ThreadAbort directory.

Figure 11.3. Thread manipulation.

Only one button is enabled at startup: the Start button. By pressing this button, a Thread is started. When the Thread is started, it waits for the ManualResetEvent to be signaled. One of the first things that you might try is to start it again. Notice that the Start button is not disabled after a Thread has started. If the Thread

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required