Mono Class Library: System.Threading.Thread Overview | Members

System.Threading.Thread.Join Method

Blocks the calling thread until the thread on which this method is invoked terminates or the specified time elapses. [Edit]

public bool Join (TimeSpan timeout)

Parameters

timeout
A TimeSpan set to the amount of time to wait for the thread to terminate. Specify Timeout.Infinite milliseconds to wait indefinitely. [Edit]

Returns

true if the thread has terminated; false if the thread has not terminated after the amount of time specified by timeout has elapsed. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value of timeout is negative and is not equal to Timeout.Infinite milliseconds, or is greater than int.MaxValue milliseconds. [Edit]
System.Threading.ThreadStateExceptionThe caller attempted to join a thread that is in the ThreadState.Unstarted state. [Edit]

Remarks

This method converts timeout to milliseconds, tests the validity of the converted value, and calls Thread.Join(int).

Note: If Timeout.Infinite milliseconds is specified for timeout, this method behaves identically to Join (), except for the return value.

Join cannot be invoked on a thread that is in the ThreadState.Unstarted state.

This method changes the state of the current thread to include ThreadState.WaitSleepJoin.

[Edit]

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0