Class Guard


  • public class Guard
    extends Object
    A Guard is the counterpart of the Semaphore that waits till all resources have been released.
    Since:
    4.9
    Author:
    Gerrit van Brakel
    • Constructor Detail

      • Guard

        public Guard()
      • Guard

        public Guard​(int numberOfResourcesToWaitFor)
    • Method Detail

      • addResource

        public void addResource()
      • releaseResource

        public void releaseResource()
        decrements internal counter, possibly awakening the thread waiting for release wait()ing in acquire()
      • isReleased

        public boolean isReleased()