|
@@ -4,18 +4,6 @@ import java.util.concurrent.*;
|
|
|
|
|
|
public class tmp {
|
|
|
public static void main(String[] args) throws InterruptedException {
|
|
|
- ThreadPoolExecutor executor = new ThreadPoolExecutor(10,
|
|
|
- 20,
|
|
|
- 60L,
|
|
|
- TimeUnit.SECONDS,
|
|
|
- new LinkedBlockingQueue<Runnable>(10),
|
|
|
- Executors.defaultThreadFactory(),
|
|
|
- new RejectedExecutionHandler() {
|
|
|
- @Override
|
|
|
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
|
|
|
- System.out.println(r.toString() + " is discard");
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+
|
|
|
}
|
|
|
}
|