|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.communication.Semaphore
public class Semaphore
Class exposing C semaphores. Be careful with this as when a semaphore blocks, it stops the entire VM.
Nested Class Summary | |
---|---|
static class |
Semaphore.Options
Options to create a semaphore with. |
Constructor Summary | |
---|---|
Semaphore(Semaphore.Options options)
Create a new semaphore. |
|
Semaphore(Semaphore.Options options,
boolean initialState)
Create a semaphore with the given initial state. |
|
Semaphore(Semaphore.Options options,
int count)
Create a counting semaphore with the given value. |
Method Summary | |
---|---|
void |
close()
Close the semaphore. |
void |
flush()
Unblock every task that is blocked by the semaphore. |
void |
free()
Release all resources associated with the semaphore. |
void |
give()
Release the semaphore. |
void |
take(double timeout)
Take the semaphore. |
boolean |
tryTake()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Semaphore(Semaphore.Options options)
options
- The options to create the semaphore with.public Semaphore(Semaphore.Options options, boolean initialState)
options
- The options to create the semaphore with.initialState
- The initial state for the semaphore to have.public Semaphore(Semaphore.Options options, int count)
options
- The options to create the semaphore with.count
- The inital count for the semaphore to hold.Method Detail |
---|
public void flush() throws SemaphoreException
SemaphoreException
public void give() throws SemaphoreException
SemaphoreException
public void take(double timeout) throws SemaphoreException
timeout
- The maximum time to block for the semaphore.
SemaphoreException
public boolean tryTake() throws SemaphoreException
SemaphoreException
public void close() throws SemaphoreException
SemaphoreException
public void free() throws SemaphoreException
SemaphoreException
|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |