This document contains the release information for the .NET Framework JoinThread sample. You will find the following sections below:
</p><ul class="Text"><li><a href="#_Sample_Overview">Overview</a></li><li><a href="#_Sample_Topics">Topics</a></li><li><a href="#_Location_of_Sample">Location</a></li><li><a href="#_Building_the_Sample">Building the sample</a></li><li><a href="#_Running_the_Sample">Running the sample</a></li><li><a href="#_sdkvars">Notes</a></li></ul><p class="SectionBreak" /><h4 class="Heading"><a name="_Sample_Overview" />
Overview
</h4><p class="Text">
This sample demonstrates use of the Thread class. The sample creates a second thread and starts it running on a static method of the App class. The primary thread then waits for the second thread to finish by calling the Join() method of the class.
The sample first creates a new Thread object and starts the thread using the Start() method. Then the sample uses the Join() method to wait for the new thread to terminate. If the Join() method were not called by the main thread of this sample, a race condition would occur between the two threads. If this were to happen, the second thread may not be able to finish processing before the application exits.
This sample is located in the <a href="." title="Jump to Folder" target="_blank">Technologies\Threading\JoinThread</a> subdirectory of the .NET Framework SDK samples directory.