package com.doverfuelingsolutions.issp.utils.thread

import java.util.concurrent.ThreadFactory

class DFSThreadFactory(private val basicName: String) : ThreadFactory {

    companion object {
        private var count = 0
    }

    override fun newThread(r: Runnable): Thread{
        val thread = Thread(r, "dfs.$basicName.${count++}")

//        if (thread.isDaemon) thread.isDaemon = false //这里改成创建非守护线程
//        println("线程池：${thread.name}--${thread.isDaemon}")

        return thread
    }
}