if (shutdown) break;
    public void run() {        while (!shutdown) {            synchronized (this) {                try {                    wait();                } catch (InterruptedException e) {                }                                if (syncTriggered) {                    sync();                }                                if (shutdown)                    break;            }        }        sync();        closeChannel();    }