Class SemaphoreImpl

java.lang.Object
com.biglybt.pifimpl.local.utils.SemaphoreImpl
All Implemented Interfaces:
Semaphore

public class SemaphoreImpl extends Object implements Semaphore
  • Field Details

    • next_sem_id

      private static long next_sem_id
    • sem

      private AESemaphore sem
  • Constructor Details

  • Method Details

    • reserve

      public void reserve()
      Specified by:
      reserve in interface Semaphore
    • reserveIfAvailable

      public boolean reserveIfAvailable()
      Specified by:
      reserveIfAvailable in interface Semaphore
    • reserve

      public boolean reserve(long timeout_millis)
      Description copied from interface: Semaphore
      reserve a semaphore subject to timeout
      Specified by:
      reserve in interface Semaphore
      Parameters:
      timeout_millis - time to wait
      Returns:
      true -> semaphore reserved, false -> timeout exceeded
    • release

      public void release()
      Specified by:
      release in interface Semaphore
    • releaseAllWaiters

      public void releaseAllWaiters()
      Specified by:
      releaseAllWaiters in interface Semaphore