|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.ua.concurrent.CObject
pt.ua.concurrent.Semaphore
pt.ua.concurrent.BoundedSemaphore
public class BoundedSemaphore
Bounded semaphore class (a semaphore that cannot exceed a given value).
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java
assert.
Constructor Summary | |
---|---|
BoundedSemaphore(int maxCount)
Creates a semaphore bounded by a maximum value of maxCount |
|
BoundedSemaphore(int maxCount,
int initialCount)
Creates a semaphore bounded by a maximum value of maxCount and starting with value initialCount |
Method Summary | |
---|---|
int |
maxCount()
Bound value. |
void |
release()
Releases the semaphore. |
Methods inherited from class pt.ua.concurrent.Semaphore |
---|
aquire |
Methods inherited from class pt.ua.concurrent.CObject |
---|
await, await, await, broadcast, interruptWaitingThreads, lockIsMine, registerAwaitingThreads, signal, syncronizedLockIsMine |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoundedSemaphore(int maxCount)
maxCount > 0
- positive bound
maxCount
- bound valuepublic BoundedSemaphore(int maxCount, int initialCount)
maxCount > 0
- positive boundinitialCount >= 0 && initialCount <= maxCount
- valid count
maxCount
- bound valueinitialCount
- initial valueMethod Detail |
---|
public void release()
count < maxCount
- counter within bound limits
release
in class Semaphore
public int maxCount()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |