mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -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)
|
culledQueue.remove(item.chunkPosition, item.sectionHeight, false)
|
||||||
|
|
||||||
meshingQueue.remove(item)
|
meshingQueue.remove(item, false)
|
||||||
|
|
||||||
loadingQueue.abort(item.chunkPosition, false)
|
loadingQueue.abort(item.chunkPosition, false)
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ class CulledQueue(
|
|||||||
if (lock) this.lock.lock()
|
if (lock) this.lock.lock()
|
||||||
this.queue.clear()
|
this.queue.clear()
|
||||||
if (lock) this.lock.unlock()
|
if (lock) this.lock.unlock()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun remove(position: ChunkPosition, lock: Boolean) {
|
fun remove(position: ChunkPosition, lock: Boolean) {
|
||||||
@ -108,9 +107,10 @@ class CulledQueue(
|
|||||||
queueIterator.remove()
|
queueIterator.remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
world.chunks.lock.release()
|
||||||
|
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
||||||
world.chunks.lock.acquire()
|
|
||||||
|
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
@ -129,12 +129,12 @@ class ChunkMeshingQueue(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun remove(item: WorldQueueItem) {
|
fun remove(item: WorldQueueItem, lock: Boolean) {
|
||||||
this.lock.lock()
|
if (lock) this.lock.lock()
|
||||||
if (this.set.remove(item)) {
|
if (this.set.remove(item)) {
|
||||||
this.queue -= item
|
this.queue -= item
|
||||||
}
|
}
|
||||||
this.lock.unlock()
|
if (lock) this.lock.unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user