com.sonyericsson.jenkins.plugins.bfa.db
Class Semaphore
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Semaphore
public Semaphore()
- Standard constructor.
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.