Is it possible to interrupt a specific thread of an ExecutorService?
问题 If I have an ExecutorService to which I feed Runnable tasks, can I select one and interrupt it? I know I can cancel the Future returned (also mentioned Here: how-to-interrupt-executors-thread), but how can I raise an InterruptedException . Cancel doesn't seem to do it (event though it should by looking at the sources, maybe the OSX implementation differs). At least this snippet doesn't print 'it!' Maybe I'm misunderstaning something and it's not the custom runnable that gets the exception?