|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--EDU.oswego.cs.dl.util.concurrent.Semaphore
|
+--EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore
Abstract base class for semaphores relying on queued wait nodes.
[ Introduction to this package. ]
| Field Summary |
| Fields inherited from interface EDU.oswego.cs.dl.util.concurrent.Sync |
ONE_CENTURY, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR |
| Method Summary | |
void |
acquire()
Wait until a permit is available, and take one |
boolean |
attempt(long msecs)
Wait at most msecs millisconds for a permit. |
void |
release()
Release a permit |
void |
release(long n)
Release N permits |
| Methods inherited from class EDU.oswego.cs.dl.util.concurrent.Semaphore |
permits |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void acquire()
throws java.lang.InterruptedException
Semaphore
acquire in interface Syncacquire in class Semaphorejava.lang.InterruptedException
public boolean attempt(long msecs)
throws java.lang.InterruptedException
Semaphore
attempt in interface Syncattempt in class Semaphoremsecs - the number of milleseconds to wait.
An argument less than or equal to zero means not to wait at all.
However, this may still require
access to a synchronization lock, which can impose unbounded
delay if there is a lot of contention among threads.
java.lang.InterruptedExceptionpublic void release()
Semaphore
release in interface Syncrelease in class Semaphorepublic void release(long n)
release in class Semaphore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||