aboutsummaryrefslogblamecommitdiff
path: root/compiler/src/dotty/tools/io/DaemonThreadFactory.scala
blob: ae0cda2600148f9337041b7dd61dcc66055dc8b4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                        
package dotty.tools
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)
}