if (started || starting) {
if(thread!=null) {
    private synchronized void startInNewThread() throws SmartFrogException {        if (started || starting) {            throw new SmartFrogException("We are already running!");        }        //note that we are starting. The new thread moves to started when it begins.        starting = true;        thread = new Thread(this);        thread.run();    }