IcanGui
Class ThreadCheck

java.lang.Object
  extended by java.lang.Thread
      extended by IcanGui.ThreadCheck
All Implemented Interfaces:
java.lang.Runnable

 class ThreadCheck
extends java.lang.Thread

This thread is used to check whether there are any threads left still trying to dispose of windows and, if not, really exit.

To dispose of the data/Frames as fast as possible, begin the dispose actions in another thread in a different ThreadGroup and check for completion in this thread. I needed to allow the current thread to be the AWT thread. Somehow, all of these threads should not interfere with each other. Checking for completion contains a sleep that must not stop the disposal of the frames but rather should continue the disposal by allowing the program to run the other threads.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  int nerr
           
private  java.lang.ThreadGroup tg
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadCheck(java.lang.ThreadGroup newtg, java.lang.String name)
           
 
Method Summary
 void run()
           
 void setNerr(int nerr)
           
 void setThreadGroup(java.lang.ThreadGroup tg)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Field Detail

tg

private java.lang.ThreadGroup tg

nerr

private int nerr
Constructor Detail

ThreadCheck

public ThreadCheck(java.lang.ThreadGroup newtg,
                   java.lang.String name)
Method Detail

setThreadGroup

public void setThreadGroup(java.lang.ThreadGroup tg)

setNerr

public void setNerr(int nerr)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread