com.ibm.rational.test.lt.kernel.action

Interface IKSemaphore

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void acquire(IKAction action, int permits)
      Acquires the given number of permits from this semaphore, blocking until all are available.
      int availablePermits()
      Returns the current number of permits available in this semaphore.
      Map getQueue()
      Get the actions waiting on the semaphore.
      int getQueueLength()
      Returns the number of actions waiting to acquire.
      int reducePermits(int reduction)
      Shrinks the number of available permits by the indicated reduction.
      void release()
      Releases a permit, returning it to the semaphore.
      void release(int permits)
      Releases the given number of permits, returning them to the semaphore.
      String toString()
      Returns a string identifying this semaphore, as well as its state.
      boolean tryAcquire()
      Acquires a permit from this semaphore, only if one is available at the time of invocation.
      boolean tryAcquire(int permits)
      Acquires the given number of permits from this semaphore, only if all are available at the time of invocation.
    • Method Detail

      • acquire

        void acquire(IKAction action,
                   int permits)
        Acquires the given number of permits from this semaphore, blocking until all are available. Action execute() is called again when the resource is available. No further processing should occur after calling acquire(). Acquire 0 permits for a binary semaphore, which should be initialized to -1.
      • availablePermits

        int availablePermits()
        Returns the current number of permits available in this semaphore.
      • getQueueLength

        int getQueueLength()
        Returns the number of actions waiting to acquire.
      • reducePermits

        int reducePermits(int reduction)
        Shrinks the number of available permits by the indicated reduction.
      • release

        void release()
        Releases a permit, returning it to the semaphore.
      • release

        void release(int permits)
        Releases the given number of permits, returning them to the semaphore.
      • toString

        String toString()
        Returns a string identifying this semaphore, as well as its state.
        Overrides:
        toString in class Object
      • tryAcquire

        boolean tryAcquire()
        Acquires a permit from this semaphore, only if one is available at the time of invocation.
      • tryAcquire

        boolean tryAcquire(int permits)
        Acquires the given number of permits from this semaphore, only if all are available at the time of invocation.
      • getQueue

        Map getQueue()
        Get the actions waiting on the semaphore.
        Returns:
        Queue of waiting actions.
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.