Parallel: wait for all ths to die

Former-commit-id: d95a5fc60c424cb1722d70ced610a81237ddb681
Former-commit-id: 64d1177a164a2a53e9beabe634a6f5997cfa8d7b
This commit is contained in:
Song Minjae
2017-01-12 21:05:23 +09:00
parent 4be06fa510
commit 36cbb0512e

View File

@@ -25,6 +25,14 @@ object ThreadParallel {
pool.forEach { it?.start() }
}
/**
* Start all thread in the pool and wait for them to all die. If the thread in the pool is NULL, it will simply ignored.
*/
fun startAllWaitForDie() {
pool.forEach { it?.start() }
pool.forEach { it?.join() }
}
/**
* Primitive locking
*/