Share via


ForkJoinPool.Close Method

Definition

Unless this is the #commonPool(), initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted, and waits until all tasks have completed execution and the executor has terminated.

[Android.Runtime.Register("close", "()V", "GetCloseHandler", ApiSince=36)]
public virtual void Close();
[<Android.Runtime.Register("close", "()V", "GetCloseHandler", ApiSince=36)>]
abstract member Close : unit -> unit
override this.Close : unit -> unit
Attributes

Remarks

Unless this is the #commonPool(), initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted, and waits until all tasks have completed execution and the executor has terminated.

If already terminated, or this is the #commonPool(), this method has no effect on execution, and does not wait. Otherwise, if interrupted while waiting, this method stops all executing tasks as if by invoking #shutdownNow(). It then continues to wait until all actively executing tasks have completed. Tasks that were awaiting execution are not executed. The interrupt status will be re-asserted before this method returns.

Added in 19.

Java documentation for java.util.concurrent.ForkJoinPool.close().

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.

Applies to