Default to caller runs policy on task rejection.
This commit is contained in:
Timothy Bish 2016-03-28 13:55:09 -04:00
parent 05f918ceb8
commit 9a866cf567
2 changed files with 5 additions and 3 deletions

View File

@ -187,11 +187,13 @@ public class TaskRunnerFactory implements Executor {
return thread;
}
});
if (rejectedTaskHandler != null) {
rc.setRejectedExecutionHandler(rejectedTaskHandler);
} else {
rc.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
}
return rc;
}

View File

@ -54,7 +54,7 @@ public final class SelectorManager {
t.setDaemon(true);
return t;
}
});
}, new ThreadPoolExecutor.CallerRunsPolicy());
return rc;
}