次の方法で共有


ForkJoinTask.CompleteExceptionally(Throwable) Method

Definition

Completes this task abnormally, and if not already aborted or cancelled, causes it to throw the given exception upon join and related operations.

[Android.Runtime.Register("completeExceptionally", "(Ljava/lang/Throwable;)V", "GetCompleteExceptionally_Ljava_lang_Throwable_Handler")]
public virtual void CompleteExceptionally (Java.Lang.Throwable? ex);
[<Android.Runtime.Register("completeExceptionally", "(Ljava/lang/Throwable;)V", "GetCompleteExceptionally_Ljava_lang_Throwable_Handler")>]
abstract member CompleteExceptionally : Java.Lang.Throwable -> unit
override this.CompleteExceptionally : Java.Lang.Throwable -> unit

Parameters

ex
Throwable

the exception to throw. If this exception is not a RuntimeException or Error, the actual exception thrown will be a RuntimeException with cause ex.

Attributes

Remarks

Completes this task abnormally, and if not already aborted or cancelled, causes it to throw the given exception upon join and related operations. This method may be used to induce exceptions in asynchronous tasks, or to force completion of tasks that would not otherwise complete. Its use in other situations is discouraged. This method is overridable, but overridden versions must invoke super implementation to maintain guarantees.

Java documentation for java.util.concurrent.ForkJoinTask.completeExceptionally(java.lang.Throwable).

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