Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 3bc8915

Browse files
committed
feat: Update threadPoolExecutor.
1 parent a3b7ed0 commit 3bc8915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/main/java/com/opensource/svgaplayer/SVGAParser.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import java.io.*
1010
import java.net.HttpURLConnection
1111
import java.net.URL
1212
import java.security.MessageDigest
13+
import java.util.concurrent.Executors
1314
import java.util.concurrent.LinkedBlockingQueue
1415
import java.util.concurrent.ThreadPoolExecutor
1516
import java.util.concurrent.TimeUnit
@@ -86,8 +87,7 @@ class SVGAParser(private val context: Context) {
8687
var fileDownloader = FileDownloader()
8788

8889
companion object {
89-
private val threadPoolBlockingQueue = LinkedBlockingQueue<Runnable>()
90-
internal var threadPoolExecutor = ThreadPoolExecutor(3, 10, 60000, TimeUnit.MILLISECONDS, threadPoolBlockingQueue)
90+
internal var threadPoolExecutor = Executors.newCachedThreadPool()
9191
fun setThreadPoolExecutor(executor: ThreadPoolExecutor) {
9292
threadPoolExecutor = executor
9393
}

0 commit comments

Comments
 (0)