|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rtsjx.Semaphore
public final class Semaphore
Semaphore that never block the producer.
The sema_post and sema_trywait can safely be used by NoHeapRealtimeThread. Unbounded blocks due to garbage collection or low priority concurrent users cannot happen.
Constructor Summary | |
---|---|
Semaphore()
Constructor. |
Method Summary | |
---|---|
int |
sema_count()
Get the count. |
boolean |
sema_post()
Producer. |
boolean |
sema_trywait()
Non blocking consumer. |
void |
sema_wait_interruptible()
Blocking interruptible consumer. |
void |
sema_wait()
Blocking consumer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Semaphore()
The initial count is 0.
Method Detail |
---|
public final void sema_wait()
Blocks until it atomically decreases a strictly positive count.
public final void sema_wait_interruptible() throws java.lang.InterruptedException
Blocks until it atomically decreases a strictly positive count or until the thread is interrupted.
java.lang.InterruptedException
- Thrown if the wait is interrupted.public final boolean sema_trywait()
public final boolean sema_post()
Atomically increase the count by one, unless it overflows.
public final int sema_count()
The value return is the count at unspecified time during the call. It may be concurrently modified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |