java.lang.ObjectEDU.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. ]
Nested Class Summary | |
protected static class |
QueuedSemaphore.WaitQueue
Base class for internal queue classes for semaphores, etc. |
Field Summary | |
protected QueuedSemaphore.WaitQueue |
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 |
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. |
protected QueuedSemaphore.WaitQueue.WaitNode |
getSignallee()
|
protected boolean |
precheck()
|
protected boolean |
recheck(QueuedSemaphore.WaitQueue.WaitNode w)
|
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final QueuedSemaphore.WaitQueue wq_
Method Detail |
public void acquire() throws InterruptedException
Semaphore
acquire
in interface Sync
acquire
in class Semaphore
InterruptedException
public boolean attempt(long msecs) throws InterruptedException
Semaphore
attempt
in interface Sync
attempt
in class Semaphore
InterruptedException
protected boolean precheck()
protected boolean recheck(QueuedSemaphore.WaitQueue.WaitNode w)
protected QueuedSemaphore.WaitQueue.WaitNode getSignallee()
public void release()
Semaphore
release
in interface Sync
release
in class Semaphore
public void release(long n)
release
in class Semaphore
Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.