Blocks the calling thread until the thread on which this method is invoked terminates or the specified time elapses.
- millisecondsTimeout
- A int containing the number of milliseconds to wait for the thread to terminate.
true if the thread has terminated; false if the thread has not terminated after millisecondsTimeout has elapsed.
Type Reason ArgumentOutOfRangeException The value of millisecondsTimeout is negative and is not equal to Timeout.Infinite . System.Threading.ThreadStateException The caller attempted to join a thread that is in the ThreadState.Unstarted state.
Note: If Timeout.Infinite is specified for millisecondsTimeout, 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 calling thread to include ThreadState.WaitSleepJoin.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0