2 package org.feistymeow.process;
5 // not compilable yet probably,
6 // plus missing the timed features of ethread.
8 import org.apache.commons.logging.Log;
9 import org.apache.commons.logging.LogFactory;
12 * A simple java thread that hearkens back to the HOOPLE C++ ethread in features.
14 * @author Chris Koeritz
16 class ethread implements Runnable
18 //fix below to use better way to get class object.
19 private static Log c_logger = LogFactory.getLog(ethread.class);
21 private volatile Thread c_RealThread = null;
23 // the only variable on which both synchronize is the "thread finished" variable.
26 c_logger.warn("this class needs to be implemented and used in an example.");
30 * Begins execution of the thread.
34 if( null == this.c_RealThread )
36 this.c_RealThread = new Thread(this);
37 this.c_RealThread.start();
42 * Stops execution of the thread, or at least attempts to.
46 Thread goAway = c_RealThread;
48 if (null != goAway) { goAway.interrupt(); }
52 * Returns true if the thread isn't null.
54 public boolean threadRunning()
56 return (null != this.c_RealThread);
61 if (false == threadRunning())
63 return; // stopped before it ever started