Class LockQueue

java.lang.Object
org.basex.core.locks.LockQueue
Direct Known Subclasses:
FairLockQueue, NonfairLockQueue

public abstract class LockQueue extends Object
Lock queue.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    Number of currently running jobs.
    protected final int
    Maximum number of parallel jobs.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    acquire(Long id, boolean read, boolean write)
    Queues the job until it can be started.
    void
    Notifies other jobs that a job has been completed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • parallel

      protected final int parallel
      Maximum number of parallel jobs.
    • jobs

      protected int jobs
      Number of currently running jobs.
  • Method Details

    • acquire

      public abstract void acquire(Long id, boolean read, boolean write) throws InterruptedException
      Queues the job until it can be started.
      Parameters:
      id - job id
      read - read flag
      write - write flag
      Throws:
      InterruptedException - interrupted exception
    • release

      public void release()
      Notifies other jobs that a job has been completed.