org.jasen.util
Class ThreadUtils

java.lang.Object
  extended byorg.jasen.util.ThreadUtils

public final class ThreadUtils
extends Object

General thread utils.

Author:
Jason Polites

Constructor Summary
ThreadUtils()
           
 
Method Summary
static boolean forceFinish(StoppableThread thread, long timeout)
          Requests a stop on the thread and forces an interrupt if the thread did not die within the given timeout.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtils

public ThreadUtils()
Method Detail

forceFinish

public static boolean forceFinish(StoppableThread thread,
                                  long timeout)
Requests a stop on the thread and forces an interrupt if the thread did not die within the given timeout.

Parameters:
thread - The thread to stop
timeout - The time in milliseconds to wait for the thread to die
Returns:
True if the thread died cleanly, or false if it needed to be interrupted