package de.duehl.threads;

/*
 * Copyright 2016 Christian Dühl. All rights reserved.
 *
 * This program is free software. You can redistribute it and/or
 * modify it under the same terms as perl:
 *
 * general:  http://dev.perl.org/licenses/
 * GPL:      http://dev.perl.org/licenses/gpl1.html
 * artistic: http://dev.perl.org/licenses/artistic.html
 */

public abstract class ARunnable implements Runnable {

    @Override
    public void run() {
        try {
            tryToRun();
        }
        catch (InterruptedException e) {
            System.out.println(Thread.currentThread() + "interrupted!");
        }
    }

    protected abstract void tryToRun() throws InterruptedException;

}
