package abra;

/**
 * Abstract base class for ABRA threads.
 * 
 * @author Lisle E. Mose (lmose at unc dot edu)
 */
public abstract class AbraRunnable implements Runnable {

	private ThreadManager threadManager;
	
	public AbraRunnable(ThreadManager threadManager) {
		this.threadManager = threadManager;
	}
	
	@Override
	public void run() {
		try {
			go();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		} finally {
			threadManager.removeThread(this);
		}
	}
	
	public abstract void go() throws Exception;
}

package abra;

/**
 * Abstract base class for ABRA threads.
 * 
 * @author Lisle E. Mose (lmose at unc dot edu)
 */
public abstract class AbraRunnable implements Runnable {

	private ThreadManager threadManager;
	
	public AbraRunnable(ThreadManager threadManager) {
		this.threadManager = threadManager;
	}
	
	@Override
	public void run() {
		try {
			go();
		} catch (Throwable t) {
			t.printStackTrace();
			System.exit(-1);
		} finally {
			threadManager.removeThread(this);
		}
	}
	
	public abstract void go() throws Exception;
}

Exit with error for larger range of error conditions in sub threads.
Exit with error for larger range of error conditions in sub threads.