Class ThreadPool.ServiceThread

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    ThreadPool

    public class ThreadPool.ServiceThread
    extends java.lang.Thread
    A service thread executes tasks.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean notified  
      protected java.lang.Runnable task
      The actual task.
      protected boolean terminated  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceThread()
      Create a new thread.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Runnable getTask()
      Get the runnable (the task).
      protected void markParked()
      (method "park" already exists in android - do not overwrite)
      protected void markUnpark()
      (method "unpark" already exists in android - do not overwrite)
      protected void remove()
      Remove the service thread from the pool.
      void run()
      Dequeue an element from the queue and execute it.
      java.lang.String toString()
      Get the string representation.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • task

        protected java.lang.Runnable task
        The actual task.
      • terminated

        protected boolean terminated
      • notified

        protected boolean notified
    • Constructor Detail

      • ServiceThread

        public ServiceThread()
        Create a new thread.
    • Method Detail

      • run

        public void run()
        Dequeue an element from the queue and execute it.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • markParked

        protected void markParked()
        (method "park" already exists in android - do not overwrite)
      • markUnpark

        protected void markUnpark()
        (method "unpark" already exists in android - do not overwrite)
      • remove

        protected void remove()
        Remove the service thread from the pool.
      • getTask

        public java.lang.Runnable getTask()
        Get the runnable (the task).
        Returns:
        The runnable.
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Thread