Bagikan melalui


Thread.Join Method

Definition

Overloads

Join()

Waits for this thread to die.

Join(Int64)

Waits at most millis milliseconds for this thread to die.

Join(Int64, Int32)

Waits at most millis milliseconds plus nanos nanoseconds for this thread to die.

Join()

Waits for this thread to die.

[Android.Runtime.Register("join", "()V", "")]
public void Join ();
[<Android.Runtime.Register("join", "()V", "")>]
member this.Join : unit -> unit
Attributes

Exceptions

if the current thread has been interrupted. The interrupted status of the current thread will be cleared before the exception is thrown.

Remarks

Waits for this thread to die.

An invocation of this method behaves in exactly the same way as the invocation

<blockquote> #join(long) join(0)</blockquote>

Java documentation for java.lang.Thread.join().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Join(Int64)

Waits at most millis milliseconds for this thread to die.

[Android.Runtime.Register("join", "(J)V", "")]
public void Join (long millis);
[<Android.Runtime.Register("join", "(J)V", "")>]
member this.Join : int64 -> unit

Parameters

millis
Int64

the time to wait in milliseconds

Attributes

Exceptions

if the current thread has been interrupted. The interrupted status of the current thread will be cleared before the exception is thrown.

Remarks

Waits at most millis milliseconds for this thread to die. A timeout of 0 means to wait forever.

This implementation uses a loop of this.wait calls conditioned on this.isAlive. As a thread terminates the this.notifyAll method is invoked. It is recommended that applications not use wait, notify, or notifyAll on Thread instances.

Java documentation for java.lang.Thread.join(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

Join(Int64, Int32)

Waits at most millis milliseconds plus nanos nanoseconds for this thread to die.

[Android.Runtime.Register("join", "(JI)V", "")]
public void Join (long millis, int nanos);
[<Android.Runtime.Register("join", "(JI)V", "")>]
member this.Join : int64 * int -> unit

Parameters

millis
Int64

the time to wait in milliseconds

nanos
Int32

0-999999 additional nanoseconds to wait

Attributes

Exceptions

if the current thread has been interrupted. The interrupted status of the current thread will be cleared before the exception is thrown.

Remarks

Waits at most millis milliseconds plus nanos nanoseconds for this thread to die. If both arguments are 0, it means to wait forever.

This implementation uses a loop of this.wait calls conditioned on this.isAlive. As a thread terminates the this.notifyAll method is invoked. It is recommended that applications not use wait, notify, or notifyAll on Thread instances.

Java documentation for java.lang.Thread.join(long, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to