Package net.glowstone.chunk
Class ChunkManager.ChunkLock
java.lang.Object
net.glowstone.chunk.ChunkManager.ChunkLock
- All Implemented Interfaces:
Iterable<GlowChunk.Key>
- Enclosing class:
- ChunkManager
A group of locks on chunks to prevent them from being unloaded while in use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacquire(GlowChunk.Key key) Acquires a lock on the given chunk key, if it's not already held.voidclear()Release all locks.iterator()voidrelease(GlowChunk.Key key) Releases a lock on the given chunk key, if it's not already held.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ChunkLock
-
-
Method Details
-
acquire
Acquires a lock on the given chunk key, if it's not already held.- Parameters:
key- the key to lock
-
release
Releases a lock on the given chunk key, if it's not already held.- Parameters:
key- the key to lock
-
clear
public void clear()Release all locks. -
toString
-
iterator
- Specified by:
iteratorin interfaceIterable<GlowChunk.Key>
-