{
context.checkAccess(AnyThreadPool.CAN_USE);
if (name == null) {
name = "Pool";
}
ThreadPool pool = new ThreadPool(name);
if (threads > 0) {
pool.setMaxThreads(threads);
}
if (tasks > 0) {
pool.setMaxTasks(tasks);
}
return new AnyThreadPool(pool);
}