oscript.util
Class WorkerThread

java.lang.Object
  extended byjava.lang.Thread
      extended byoscript.util.WorkerThread
All Implemented Interfaces:
java.lang.Runnable

public class WorkerThread
extends java.lang.Thread

A common minimum priority worker thread for all background tasks.

Version:
1
Author:
Rob Clark (rob@ti.com)

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static void addRunnable(java.lang.Runnable r, int frequency)
          Add a runnable to be called periodically from the background worker thread.
static void invokeLater(java.lang.Runnable r)
          Call the specified runnable from the worker thread as soon as possible.
static void removeRunnable(java.lang.Runnable r)
          Remove a runnable.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, 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
 

Method Detail

invokeLater

public static void invokeLater(java.lang.Runnable r)
Call the specified runnable from the worker thread as soon as possible.


addRunnable

public static void addRunnable(java.lang.Runnable r,
                               int frequency)
Add a runnable to be called periodically from the background worker thread.

Parameters:
r - the runnable

removeRunnable

public static void removeRunnable(java.lang.Runnable r)
Remove a runnable.


run

public void run()