Udostępnij za pośrednictwem


IExecutorService.AwaitTermination(Int64, TimeUnit) Method

Definition

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

[Android.Runtime.Register("awaitTermination", "(JLjava/util/concurrent/TimeUnit;)Z", "GetAwaitTermination_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool AwaitTermination (long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("awaitTermination", "(JLjava/util/concurrent/TimeUnit;)Z", "GetAwaitTermination_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AwaitTermination : int64 * Java.Util.Concurrent.TimeUnit -> bool

Parameters

timeout
Int64

the maximum time to wait

unit
TimeUnit

the time unit of the timeout argument

Returns

true if this executor terminated and false if the timeout elapsed before termination

Attributes

Exceptions

if interrupted while waiting

Remarks

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Java documentation for java.util.concurrent.ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit).

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