Blocks the calling thread until a thread terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping.
- timeout
- A TimeSpan set to the amount of time to wait for the thread to terminate.
true if the thread terminated; false if the thread has not terminated after the amount of time specified by the timeout parameter has elapsed.
Type Reason ArgumentOutOfRangeException The value of timeout is negative and is not equal to Timeout.Infinite milliseconds, or is greater than int.MaxValue milliseconds. System.Threading.ThreadStateException The caller attempted to join a thread that is in the ThreadState.Unstarted state.
If Timeout.Infinite is specified for timeout, this method behaves identically to the Thread.Join method overload, except for the return value.
If the thread has already terminated when erload:System.Threading.Thread.Join is called, the method returns immediately.
This method changes the state of the current thread to include ThreadState.WaitSleepJoin. You cannot invoke Join on a thread that is in the ThreadState.Unstarted state.