Add missing running threads decrease
Change-Id: Iced76c05e64a51aaa3fc99c8b5700dfb205ebbea
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt
index 7de7cf1..79a862d 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt
@@ -71,7 +71,7 @@
LOGGER.severe("Worker $it failed to write to process: ${e.message}")
threads.remove(currentThread())
threadCount--
- return@launch //break
+ cancel()
}
}
@@ -86,7 +86,7 @@
when (line) {
"# eof" -> {
LOGGER.info("Worker $it got EOF in output")
- inputGotEof = true;
+ inputGotEof = true
return@forEach }
"# eot" -> {
printOutput(output.toString())
@@ -118,6 +118,7 @@
e.printStackTrace()
LOGGER.warning("Worker $it failed: ${e.message}")
threads.remove(currentThread())
+ threadCount--
}
}.start()
}