protected void doWork(){ final Thread t_=t; while(true) { try { Thread.interrupted(); final Runnable r = getTask(); if (r == poison || r == null){ return; } onTaskDequeued(r); Throwable error = null; try { beforeExecute(t_, r); //inside try. to ensure balance r.run(); onTaskCompletedEvent(r); } catch(Throwable throwable) { error = throwable; } finally { afterExecute(t_, r, error); } } catch (Throwable throwable) { } } }