Share via


ForkJoinPool.DrainTasksTo(ICollection<ForkJoinTask>) Method

Definition

Removes all available unexecuted submitted and forked tasks from scheduling queues and adds them to the given collection, without altering their execution status.

[Android.Runtime.Register("drainTasksTo", "(Ljava/util/Collection;)I", "GetDrainTasksTo_Ljava_util_Collection_Handler")]
protected virtual int DrainTasksTo (System.Collections.Generic.ICollection<Java.Util.Concurrent.ForkJoinTask>? c);
[<Android.Runtime.Register("drainTasksTo", "(Ljava/util/Collection;)I", "GetDrainTasksTo_Ljava_util_Collection_Handler")>]
abstract member DrainTasksTo : System.Collections.Generic.ICollection<Java.Util.Concurrent.ForkJoinTask> -> int
override this.DrainTasksTo : System.Collections.Generic.ICollection<Java.Util.Concurrent.ForkJoinTask> -> int

Parameters

c
ICollection<ForkJoinTask>

the collection to transfer elements into

Returns

the number of elements transferred

Attributes

Remarks

Removes all available unexecuted submitted and forked tasks from scheduling queues and adds them to the given collection, without altering their execution status. These may include artificially generated or wrapped tasks. This method is designed to be invoked only when the pool is known to be quiescent. Invocations at other times may not remove all tasks. A failure encountered while attempting to add elements to collection c may result in elements being in neither, either or both collections when the associated exception is thrown. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

Java documentation for java.util.concurrent.ForkJoinPool.drainTasksTo(java.util.Collection<? super java.util.concurrent.ForkJoinTask<?>>).

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