edu.northwestern.at.utils
Class ThreadUtils

java.lang.Object
  extended by edu.northwestern.at.utils.ThreadUtils

public class ThreadUtils
extends java.lang.Object

Thread utilities.

This static class provides various utility methods for working with threads.


Constructor Summary
protected ThreadUtils()
          Can't instantiate but can override.
 
Method Summary
static void setPriority(java.lang.Thread thread, int priority)
          Set thread priority.
static void sleep(int sleepTime)
          Sleep for specified number of milliseconds.
static void waitForThread(java.lang.Thread thread)
          Wait for a thread to finish.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtils

protected ThreadUtils()
Can't instantiate but can override.

Method Detail

waitForThread

public static void waitForThread(java.lang.Thread thread)
Wait for a thread to finish.

Parameters:
thread - The thread to wait for.

setPriority

public static void setPriority(java.lang.Thread thread,
                               int priority)
Set thread priority.

Parameters:
thread - The thread.
priority - The new thread priority.

sleep

public static void sleep(int sleepTime)
Sleep for specified number of milliseconds.

Parameters:
sleepTime - The number of milliseconds yo sleep.