public Future<?> executeOnPooledThread(@NotNull final Runnable action) { return ourThreadExecutorsService.submit( new Runnable() { public void run() { try { action.run(); } catch (ProcessCanceledException e) { // ignore } catch (Throwable t) { LOG.error(t); } finally { Thread.interrupted(); // reset interrupted status } } }); }
@Override public <T> Future<T> executeOnPooledThread(@NotNull final Callable<T> action) { return ourThreadExecutorsService.submit( new Callable<T>() { public T call() { try { return action.call(); } catch (ProcessCanceledException e) { // ignore } catch (Throwable t) { LOG.error(t); } finally { Thread.interrupted(); // reset interrupted status } return null; } }); }