|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
common.StoppableThread
public class StoppableThread
Permet d'arrêter proprement un Thread.
quit()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private boolean |
isFree
Devient vrai si les ressources liées à cette classe ont déjà été libérées La variable est volatile au lieu d'être synchronized (suffisant car le type est simple, voir l'exemple dans la documentation). |
protected boolean |
quitQuery
Devient vrai si une demande d'arrêt a été faite La variable est volatile au lieu d'être synchronized (suffisant car le type est simple, voir l'exemple dans la documentation). |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
StoppableThread()
|
|
| Method Summary | |
|---|---|
protected void |
doFree()
Prends les dispositions pour libérer les ressources utilisées dans cette classe. |
protected void |
doQuit()
Prends les dispositions pour que le thread termine et sorte seul de sa méthode run(). |
protected void |
free()
Libère les ressources liées à la classe. |
void |
quit()
Ferme le thread. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
| Field Detail |
|---|
private volatile boolean isFree
free()protected volatile boolean quitQuery
quit()| Constructor Detail |
|---|
public StoppableThread()
| Method Detail |
|---|
protected void doQuit()
Thread.run(),
quitQuery,
quit()protected void doFree()
Thread.run(),
isFree,
free()protected final void free()
Thread.run(),
isFree,
doFree()public void quit()
Thread.join(),
free(),
doQuit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||