aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/io/DaemonThreadFactory.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-01-31 18:36:01 +0100
committerMartin Odersky <odersky@gmail.com>2013-01-31 18:36:01 +0100
commit340477017cea9dee6dff06f976cc1a42bb858671 (patch)
tree9c82f3b70c85cc1ce9d805145a0a1535e527ed3b /src/dotty/tools/io/DaemonThreadFactory.scala
parent398a7a97a34b640d8e6922092db1d73836d0512c (diff)
downloaddotty-340477017cea9dee6dff06f976cc1a42bb858671.tar.gz
dotty-340477017cea9dee6dff06f976cc1a42bb858671.tar.bz2
dotty-340477017cea9dee6dff06f976cc1a42bb858671.zip
Added io infrastructure needed for SymbolLoaders
Diffstat (limited to 'src/dotty/tools/io/DaemonThreadFactory.scala')
-rw-r--r--src/dotty/tools/io/DaemonThreadFactory.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dotty/tools/io/DaemonThreadFactory.scala b/src/dotty/tools/io/DaemonThreadFactory.scala
new file mode 100644
index 000000000..ae0cda260
--- /dev/null
+++ b/src/dotty/tools/io/DaemonThreadFactory.scala
@@ -0,0 +1,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)
+}