Share via


ForkJoinTask.Reinitialize Method

Definition

Resets the internal bookkeeping state of this task, allowing a subsequent fork.

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

Remarks

Resets the internal bookkeeping state of this task, allowing a subsequent fork. This method allows repeated reuse of this task, but only if reuse occurs when this task has either never been forked, or has been forked, then completed and all outstanding joins of this task have also completed. Effects under any other usage conditions are not guaranteed. This method may be useful when executing pre-constructed trees of subtasks in loops.

Upon completion of this method, isDone() reports false, and getException() reports null. However, the value returned by getRawResult is unaffected. To clear this value, you can invoke setRawResult(null).

Java documentation for java.util.concurrent.ForkJoinTask.reinitialize().

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