Add a watchdog to interrupt long-running tasks

The watchdog waits on a separate thread and is notified when tasks begin
and end. When a work thread exceeds the amount of time allowed to
complete the task the watchdog calls Thread.interrupt() on that thread,
after which it is the thread's duty to abort.
11 files changed