Class WaitSemaphore

  • All Implemented Interfaces:
    Sync, WaitSync

    public class WaitSemaphore
    extends Semaphore
    implements WaitSync
    Wait exclusive semaphore with wait - notify primitives
    Version:
    $Revision$
    • Field Detail

      • m_waiters

        private int m_waiters
    • Constructor Detail

      • WaitSemaphore

        public WaitSemaphore()
    • Method Detail

      • doWait

        public void doWait()
                    throws java.lang.InterruptedException
        Description copied from interface: WaitSync
        Pone in wait status this sync, until WaitSync.doNotify() is called to wake it up.
        Specified by:
        doWait in interface WaitSync
        Throws:
        java.lang.InterruptedException
        See Also:
        WaitSync.doNotify()
      • doNotify

        public void doNotify()
                      throws java.lang.InterruptedException
        Description copied from interface: WaitSync
        Wakes up this sync that has been posed in wait status by a WaitSync.doWait() call. If this sync is not waiting, invoking this method should have no effect.
        Specified by:
        doNotify in interface WaitSync
        Throws:
        java.lang.InterruptedException
        See Also:
        WaitSync.doWait()
      • getWaiters

        public int getWaiters()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Semaphore