protected void beforeExecute(Thread t, Runnable r) {
        super.beforeExecute(t, r);
        pause_lock.lock();
        try {
            while (is_paused)
                unpaused.await();
        } catch (InterruptedException e) {
            t.interrupt();
        } finally {
            pause_lock.unlock();
        }
    }