mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
world renderer: fix some locking issues
This commit is contained in:
parent
7ce26ba406
commit
5672bacb75
@ -227,7 +227,7 @@ class WorldRenderer(
|
||||
|
||||
culledQueue.remove(item.chunkPosition, item.sectionHeight, false)
|
||||
|
||||
meshingQueue.remove(item)
|
||||
meshingQueue.remove(item, false)
|
||||
|
||||
loadingQueue.abort(item.chunkPosition, false)
|
||||
|
||||
|
@ -55,7 +55,6 @@ class CulledQueue(
|
||||
if (lock) this.lock.lock()
|
||||
this.queue.clear()
|
||||
if (lock) this.lock.unlock()
|
||||
|
||||
}
|
||||
|
||||
fun remove(position: ChunkPosition, lock: Boolean) {
|
||||
@ -108,9 +107,10 @@ class CulledQueue(
|
||||
queueIterator.remove()
|
||||
}
|
||||
}
|
||||
world.chunks.lock.release()
|
||||
|
||||
lock.release()
|
||||
|
||||
world.chunks.lock.acquire()
|
||||
|
||||
return list
|
||||
}
|
||||
|
@ -129,12 +129,12 @@ class ChunkMeshingQueue(
|
||||
}
|
||||
|
||||
|
||||
fun remove(item: WorldQueueItem) {
|
||||
this.lock.lock()
|
||||
fun remove(item: WorldQueueItem, lock: Boolean) {
|
||||
if (lock) this.lock.lock()
|
||||
if (this.set.remove(item)) {
|
||||
this.queue -= item
|
||||
}
|
||||
this.lock.unlock()
|
||||
if (lock) this.lock.unlock()
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user