Initialize value before starting thread

Depending on how quickly the thread starts up, this can cause an NPE
(see #5938).
This commit is contained in:
Ethan Atkins 2020-10-05 20:30:14 -07:00
parent d0b8cf0984
commit f3f40d6442
1 changed files with 1 additions and 1 deletions

View File

@ -608,9 +608,9 @@ object Terminal {
*/
private class ReadThread extends Thread with AutoCloseable {
val result = new LinkedBlockingQueue[Integer]
val running = new AtomicBoolean(true)
setDaemon(true)
start()
val running = new AtomicBoolean(true)
override def run(): Unit = while (running.get) {
bootInputStreamHolder.get match {
case null =>