Java.Util.Concurrent.ForkJoinTask.Cancel Method
Attempts to cancel execution of this task.

Syntax

[Android.Runtime.Register("cancel", "(Z)Z", "GetCancel_ZHandler")]
public virtual bool Cancel (bool mayInterruptIfRunning)

Parameters

mayInterruptIfRunning
this value has no effect in the default implementation because interrupts are not used to control cancellation.

Returns

Documentation for this section has not yet been entered.

Remarks

Attempts to cancel execution of this task. This attempt will fail if the task has already completed or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, execution of this task is suppressed. After this method returns successfully, unless there is an intervening call to ForkJoinTask.Reinitialize, subsequent calls to ForkJoinTask.IsCancelled, ForkJoinTask.IsDone, and cancel will return true and calls to ForkJoinTask.Join and related methods will result in CancellationException.

This method may be overridden in subclasses, but if so, must still ensure that these properties hold. In particular, the cancel method itself must not throw exceptions.

This method is designed to be invoked by other tasks. To terminate the current task, you can just return or throw an unchecked exception from its computation method, or invoke ForkJoinTask.CompleteExceptionally(Java.Lang.Throwable).

[Android Documentation]

Requirements

Namespace: Java.Util.Concurrent
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0