cleanupWork();
    public void doWork() {        prepareToWork();        if (firstWork) {            firstWork = false;            Thread t = new Thread(this);            t.start();        } else {            synchronized (this) {                try {                    notify();                    wait();                } catch (InterruptedException e) {                    e.printStackTrace();                }            }        }        cleanupWork();    }