|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEDU.oswego.cs.dl.util.concurrent.Semaphore
EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore
EDU.oswego.cs.dl.util.concurrent.PrioritySemaphore
public class PrioritySemaphore
A Semaphore that grants requests to threads with higher Thread priority rather than lower priority when there is contention. Ordering of requests with the same priority is approximately FIFO. Priorities are based on Thread.getPriority. Changing the priority of an already-waiting thread does NOT change its ordering. This class also does not specially deal with priority inversion -- when a new high-priority thread enters while a low-priority thread is currently running, their priorities are not artificially manipulated.
[ Introduction to this package. ]
Nested Class Summary | |
---|---|
protected static class |
PrioritySemaphore.PriorityWaitQueue
|
Nested classes/interfaces inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore |
---|
QueuedSemaphore.WaitQueue |
Field Summary |
---|
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore |
---|
wq_ |
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.Semaphore |
---|
permits_ |
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 |
Constructor Summary | |
---|---|
PrioritySemaphore(long initialPermits)
Create a Semaphore with the given initial number of permits. |
Method Summary |
---|
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore |
---|
acquire, attempt, getSignallee, precheck, recheck, release, release |
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.Semaphore |
---|
permits |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrioritySemaphore(long initialPermits)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |