语言

Process.WaitForAsync 方法

定义

重载

名称 说明
WaitForAsync()

异步等待子进程终止。

WaitForAsync(Int64, TimeUnit)

异步等待,直到子进程终止或指定的等待时间结束。

WaitForAsync()

异步等待子进程终止。

public System.Threading.Tasks.Task<int> WaitForAsync();
member this.WaitForAsync : unit -> System.Threading.Tasks.Task<int>

返回

其结果为子进程退出代码的任务。 按照约定,零表示正常终止。

注解

此方法使用Task.Run对线程池线程进行调用WaitFor()。

适用于

WaitForAsync(Int64, TimeUnit)

异步等待,直到子进程终止或指定的等待时间结束。

public System.Threading.Tasks.Task<bool> WaitForAsync(long timeout, Java.Util.Concurrent.TimeUnit? unit);
member this.WaitForAsync : int64 * Java.Util.Concurrent.TimeUnit -> System.Threading.Tasks.Task<bool>

参数

timeout
Int64

最大等待持续时间,以单位参数指定的单位为单位。

unit
TimeUnit

的时间单位 timeout。

返回

如果子进程已退出,则其结果为 true 的任务;如果等待在退出之前结束,则为 false。

注解

此方法使用Task.Run对线程池线程进行调用WaitFor(Int64, TimeUnit)。

适用于