scala.tools.nsc.io.DaemonThreadFactory.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-compiler Show documentation
Show all versions of scala-compiler Show documentation
Compiler for the Scala Programming Language
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.nsc
package io
import java.util.concurrent._
class DaemonThreadFactory extends ThreadFactory {
def newThread(r: Runnable): Thread = {
val thread = new Thread(r)
thread setDaemon true
thread
}
}
object DaemonThreadFactory {
def newPool() = Executors.newCachedThreadPool(new DaemonThreadFactory)
}