mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 12:25:12 -04:00
IndexAssetsManager: properly workaround bad timing issues, GH-6
This commit is contained in:
parent
902c7aef4a
commit
5d69d0bad5
@ -115,8 +115,12 @@ class IndexAssetsManager(
|
||||
|
||||
val size = data["size"]?.toLong() ?: -1
|
||||
val hash = data["hash"].toString()
|
||||
if (tasks.count > DefaultThreadPool.threadCount - 1) {
|
||||
tasks.waitForChange(100L)
|
||||
while (tasks.count > DefaultThreadPool.threadCount - 1) {
|
||||
// ToDo: The timeout is just a workaround for bad multi threading timings
|
||||
try {
|
||||
tasks.waitForChange(100L)
|
||||
} catch (_: InterruptedException) {
|
||||
}
|
||||
}
|
||||
tasks.inc()
|
||||
DefaultThreadPool += ThreadPoolRunnable(priority = ThreadPool.LOW) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user