Partager via


ThreadPoolExecutor.Purge Method

Definition

Tries to remove from the work queue all Future tasks that have been cancelled.

[Android.Runtime.Register("purge", "()V", "GetPurgeHandler")]
public virtual void Purge ();
[<Android.Runtime.Register("purge", "()V", "GetPurgeHandler")>]
abstract member Purge : unit -> unit
override this.Purge : unit -> unit
Attributes

Remarks

Tries to remove from the work queue all Future tasks that have been cancelled. This method can be useful as a storage reclamation operation, that has no other impact on functionality. Cancelled tasks are never executed, but may accumulate in work queues until worker threads can actively remove them. Invoking this method instead tries to remove them now. However, this method may fail to remove tasks in the presence of interference by other threads.

Java documentation for java.util.concurrent.ThreadPoolExecutor.purge().

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