|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--readerwriter.SemaphoredThread
La classe implemnta uno speciale tipo di thread, il cui flusso di esecuzione viene assoggettato a uno o piu' semafori anche innestati fra di loro. La classe permette la gestione dei semafori, consentendo di ricordare tutti i semafori dei quali il thread possiede la chiave, di richiedere la chiave di un singolo thread, richiedere la chiave di tutti i semafori in SOSPENSIONE, rilasciare la chiave di un semaforo, rilasciare temporaneamente la chiave di tutti i semafori in memoria, e quindi portarli nello stato di SOSPENSIONE e rilasciare definitivamente la chiave di tutti i semafori in memoria
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
SemaphoredThread()
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.Runnable target)
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.Runnable target,
java.lang.String name)
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.String name)
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.ThreadGroup group,
java.lang.Runnable target)
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.ThreadGroup group,
java.lang.Runnable target,
java.lang.String name)
Alloca un nuovo oggetto SemaphoredThread |
|
SemaphoredThread(java.lang.ThreadGroup group,
java.lang.String name)
Alloca un nuovo oggetto SemaphoredThread |
Method Summary | |
void |
down(Semaphore sem)
Richiede la chiave su uno specifico semaforo |
void |
downWaitAll()
Si richiede il ripristino di tutte le chiavi in sospeso, che prima erano in possesso del thread |
void |
up(Semaphore sem)
Si richiede il rilascio di uno specifico semaforo |
void |
upAll()
si richiede il rilascio definitivo di tutti i semafori in possesso del thread |
void |
upWaitAll()
Si richiede il rilascio temporaneo di tutte le chiavi dei semafori in possesso del thread |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SemaphoredThread()
SemaphoredThread
public SemaphoredThread(java.lang.Runnable target)
SemaphoredThread
public SemaphoredThread(java.lang.Runnable target, java.lang.String name)
SemaphoredThread
public SemaphoredThread(java.lang.String name)
SemaphoredThread
public SemaphoredThread(java.lang.ThreadGroup group, java.lang.Runnable target)
SemaphoredThread
public SemaphoredThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
SemaphoredThread
public SemaphoredThread(java.lang.ThreadGroup group, java.lang.String name)
SemaphoredThread
Method Detail |
public void down(Semaphore sem)
sem
- Semaforo del quale si richiede la chiavepublic void up(Semaphore sem)
sem
- Semaforo del quale si richiede il rilascio della chiavepublic void upWaitAll()
public void downWaitAll()
public void upAll()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |