com.sonyericsson.jenkins.plugins.bfa.db
Class Semaphore

java.lang.Object
  extended by com.sonyericsson.jenkins.plugins.bfa.db.Semaphore

public class Semaphore
extends Object

"Real" binary semaphore, where subsequent calls to release do not make the semaphore be able to acquire more than the maximum permits.

Author:
Tomas Westling <tomas.westling@sonyericsson.com>

Constructor Summary
Semaphore()
          Standard constructor.
 
Method Summary
 void acquire()
           
 void release()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore

public Semaphore()
Standard constructor.

Method Detail

acquire

public void acquire()
             throws InterruptedException
Throws:
InterruptedException - if the java.util.concurrent.Semaphore is interrupted.
See Also:
The difference is that this tries to acquire all available permits if there are any and 1 if there are none.

release

public void release()
See Also:
Releases a permit, returning it to the semaphore.


Copyright © 2004-2014. All Rights Reserved.