Class ChunkManager.ChunkLock

java.lang.Object
net.glowstone.chunk.ChunkManager.ChunkLock
All Implemented Interfaces:
Iterable<GlowChunk.Key>
Enclosing class:
ChunkManager

public static class ChunkManager.ChunkLock extends Object implements Iterable<GlowChunk.Key>
A group of locks on chunks to prevent them from being unloaded while in use.
  • Constructor Details

  • Method Details

    • acquire

      public void acquire(GlowChunk.Key key)
      Acquires a lock on the given chunk key, if it's not already held.
      Parameters:
      key - the key to lock
    • release

      public void release(GlowChunk.Key key)
      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

      public String toString()
      Overrides:
      toString in class Object
    • iterator

      public Iterator<GlowChunk.Key> iterator()
      Specified by:
      iterator in interface Iterable<GlowChunk.Key>