From 007a8f2a70a4a48f72f72e183bc1af5c560e423f Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 28 May 2014 10:07:35 -0400 Subject: [PATCH] ServerApplication: yield before we check on the dumper thread --- launch/src/main/scala/xsbt/boot/ServerApplication.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/launch/src/main/scala/xsbt/boot/ServerApplication.scala b/launch/src/main/scala/xsbt/boot/ServerApplication.scala index b867a73d1..9133fd29b 100644 --- a/launch/src/main/scala/xsbt/boot/ServerApplication.scala +++ b/launch/src/main/scala/xsbt/boot/ServerApplication.scala @@ -113,6 +113,9 @@ class StreamDumper(in: java.io.BufferedReader, out: java.io.PrintStream) extends // any stuff. if (waitForErrors) { endTime.set(System.currentTimeMillis + 2000) + // at this point we'd rather the dumper thread run + // before we check whether to sleep + Thread.yield() // let ourselves read more (thread should exit on earlier of endTime or EOF) while (isAlive() && (endTime.get > System.currentTimeMillis)) Thread.sleep(50)