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

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

The 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