diff --git a/Aria/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java b/Aria/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java index 1ba8a37c..7d4ad2d0 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java +++ b/Aria/src/main/java/com/arialyy/aria/core/manager/ThreadTaskManager.java @@ -52,6 +52,32 @@ public class ThreadTaskManager { mExePool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); } + /** + * 删除所有线程任务 + */ + public void removeAllThreadTask() { + if (mThreadTasks.isEmpty()) { + return; + } + try { + LOCK.tryLock(2, TimeUnit.SECONDS); + for (Set threads : mThreadTasks.values()) { + for (FutureContainer container : threads) { + if (container.future.isDone() || container.future.isCancelled()) { + continue; + } + container.threadTask.destroy(); + } + threads.clear(); + } + mThreadTasks.clear(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + LOCK.unlock(); + } + } + /** * 启动线程任务 * diff --git a/Aria/src/main/java/com/arialyy/aria/core/queue/AbsTaskQueue.java b/Aria/src/main/java/com/arialyy/aria/core/queue/AbsTaskQueue.java index 062fa37c..b08fa194 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/queue/AbsTaskQueue.java +++ b/Aria/src/main/java/com/arialyy/aria/core/queue/AbsTaskQueue.java @@ -112,7 +112,7 @@ public abstract class AbsTaskQueue'`替换为 ``` @@ -118,25 +118,15 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 - + v_3.6.5 - - fix bug https://github.com/AriaLyy/Aria/issues/403 - - fix bug https://github.com/AriaLyy/Aria/issues/414 - - fix bug https://github.com/AriaLyy/Aria/issues/406 - - fix bug https://github.com/AriaLyy/Aria/issues/407 - - fix bug https://github.com/AriaLyy/Aria/issues/416 - - fix bug https://github.com/AriaLyy/Aria/issues/420 - - fix bug https://github.com/AriaLyy/Aria/issues/422 - - 新增ftp上传拦截器 https://github.com/AriaLyy/Aria/issues/402 - - 重构线程任务模块 - - 新增m3u8协议的文件下载 - - 修复拦截器可能出现的空指针问题 - - 移除`DownloadGroupEntity`字段`groupHash`的主键约束,`DownloadEntity`字段`groupHash`的外键约束,`TaskRecord`字段`dGroupHash`的外键约束 - - 优化关联查询的性能 - - 修复任务记录删除失败的问题 - - 优化网络连接状态获取的逻辑 - - 修复配置文件的某些配置失效的问题 - - 新增m3u8切片状态注解`@M3U8.onPeerStart`,`@M3U8.onPeerComplete`,`@M3U8.onPeerFail` - - 新增动态指定m3u8协议视频的下载功能(边下边播下载支持),[详情](https://aria.laoyuyu.me/aria_doc/download/m3u8_vod.html) + + v_3.6.6 + - fix bug https://github.com/AriaLyy/Aria/issues/426 + - fix bug https://github.com/AriaLyy/Aria/issues/429 + - fix bug https://github.com/AriaLyy/Aria/issues/428 + - fix bug https://github.com/AriaLyy/Aria/issues/427 + - fix bug https://github.com/AriaLyy/Aria/issues/431 + - fix bug https://github.com/AriaLyy/Aria/issues/441 + - 修复普通下载任务、组合任务共享执行队列、缓存池的问题 + - 修复组合任务启动失败时,`DownloadGroupEntity`的状态变为执行中的问题 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) diff --git a/build.gradle b/build.gradle index b0fe1385..4bf2e476 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ task clean(type: Delete) { ext { userOrg = 'arialyy' groupId = 'com.arialyy.aria' - publishVersion = '3.6.6_beta_3' + publishVersion = '3.6.6' // publishVersion = '1.0.4' //FTP插件 repoName='maven' desc = 'android 下载框架'