Use Thread.interrupted() method to give run loop chance to leave.