This documentation is archived and is not being maintained.

Thread.Join Method (Int32)

Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

public bool Join (
	int millisecondsTimeout
public boolean Join (
	int millisecondsTimeout
public function Join (
	millisecondsTimeout : int
) : boolean
Not applicable.



The number of milliseconds to wait for the thread to terminate.

Return Value

true if the thread has terminated; false if the thread has not terminated after the amount of time specified by the millisecondsTimeout parameter has elapsed.

Exception typeCondition


The value of millisecondsTimeout is negative and is not equal to Timeout.Infinite in milliseconds.


The thread has not been started.

If Timeout.Infinite is specified for the millisecondsTimeout parameter, this method behaves identically to the Join method overload, except for the return value.

If the thread has already terminated when Join is called, the method returns immediately.

This method changes the state of the calling thread to include ThreadState.WaitSleepJoin. You cannot invoke Join on a thread that is in the ThreadState.Unstarted state.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0