commit | 1523a9a5573544a502f01187cf5a866e25613cc5 | [log] [tgz] |
---|---|---|
author | Marc Kupietz <kupietz@ids-mannheim.de> | Mon May 26 17:01:56 2025 +0200 |
committer | Marc Kupietz <kupietz@ids-mannheim.de> | Mon May 26 17:01:56 2025 +0200 |
tree | 45dcb6629d856a45dedc86c6f845ac494b5a692e | |
parent | 0a5b5fff42d8df85675ad09b7e28c2b349522bbf [diff] |
Fix ConcurrentModificationException Change-Id: Ic0e8248badca7c751f236a254dcfbbd1752155a9
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 e5c9e68..31e2f46 100644 --- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt +++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/AnnotationWorkerPool.kt
@@ -173,7 +173,9 @@ sleep(100) // Wait for queue to empty } LOGGER.info("Queue is empty, waiting for workers to finish") - threads.forEach(Thread::join) + // Create a copy of the threads list to avoid ConcurrentModificationException + val threadsCopy = threads.toList() + threadsCopy.forEach(Thread::join) LOGGER.info("All workers finished") } }