All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dankito.utils.ThreadPool.kt Maven / Gradle / Ivy

There is a newer version: 1.0.20
Show newest version
package net.dankito.utils

import java.util.concurrent.Executors


open class ThreadPool : IThreadPool {

    protected val threadPool = Executors.newCachedThreadPool()


    override fun runAsync(runnable: () -> Unit) {
        threadPool.execute(runnable)
    }

    override fun shutDown() {
        if (threadPool.isShutdown == false) {
            threadPool.shutdownNow()
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy