![](/img/trans.png)
[英]Get all AsyncTasks that are executed and currently running in Android app
[英]How to get the total number of AsyncTasks currently running in parallel in the thread pool?
在計划新的AsyncTask之前,我需要檢查當前並行執行的AsyncTask的數量,以便僅在並發任務的數量小於最大池大小時才計划新任務。
獲取池中所有當前任務計數的最佳方法是什么?
返回正在主動執行任務的線程的大概數量。
threadPool.getActiveCount()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.