public abstract class PausableThread extends Thread
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PausableThread.ThreadPriority
Specifies the scheduling priority of a
Thread. |
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
PausableThread() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRun()
Called once at the end of the
run() method. |
void |
awaitPausing()
Causes the current thread to wait until this thread is pausing.
|
protected abstract void |
doWork()
Called when this thread is not paused and should do its work.
|
protected abstract PausableThread.ThreadPriority |
getThreadPriority() |
protected abstract boolean |
hasWork() |
void |
interrupt() |
boolean |
isPausing() |
void |
pause()
The thread should stop its work temporarily.
|
void |
proceed()
The paused thread should continue with its work.
|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic final void awaitPausing()
public final boolean isPausing()
public final void pause()
public final void proceed()
protected void afterRun()
run() method. The default implementation is empty.protected abstract void doWork()
throws InterruptedException
InterruptedException - if the thread has been interrupted.protected abstract PausableThread.ThreadPriority getThreadPriority()
protected abstract boolean hasWork()
Copyright © 2015 mapsforge.org