mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-09 13:21:51 +09:00
1dim-ised lightmap
This commit is contained in:
@@ -18,6 +18,16 @@ object ThreadParallel {
|
||||
pool[index] = Thread(runnable, "$prefix-$index")
|
||||
}
|
||||
|
||||
fun map(index: Int, runFunc: (Int) -> Unit, prefix: String) {
|
||||
val runnable = object : Runnable {
|
||||
override fun run() {
|
||||
runFunc(index)
|
||||
}
|
||||
}
|
||||
|
||||
map(index, runnable, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Start all thread in the pool. If the thread in the pool is NULL, it will simply ignored.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user