mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Parallel: wait for all ths to die
Former-commit-id: d95a5fc60c424cb1722d70ced610a81237ddb681 Former-commit-id: 64d1177a164a2a53e9beabe634a6f5997cfa8d7b
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user