gpt4 book ai didi

java - ExecutorService 中的 Activity 线程

转载 作者:IT老高 更新时间:2023-10-28 20:22:40 26 4
gpt4 key购买 nike

关于如何确定 ExecutorService 中当前运行的 Activity 线程数的任何想法?

最佳答案

使用 ThreadPoolExecutor实现并调用getActiveCount()就可以了:

int getActiveCount() 
// Returns the approximate number of threads that are actively executing tasks.

ExecutorService 接口(interface)没有为此提供方法,它取决于实现。

关于java - ExecutorService 中的 Activity 线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/80787/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com