public void run() { try { while (!Thread.interrupted()) { // Blocks until next piece of toast is available: Toast t = butteredQueue.take(); t.jam(); print(t); finishedQueue.put(t); } } catch (InterruptedException e) { print("Jammer interrupted"); } print("Jammer off"); }