mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Merge pull request #1782 from Raxcl/patch-4
Update java-concurrent-questions-03.md
This commit is contained in:
commit
7628b6178d
@ -250,7 +250,7 @@ public class ThreadPoolExecutorDemo {
|
|||||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
//创建WorkerThread对象(WorkerThread类实现了Runnable 接口)
|
//创建 MyRunnable 对象(MyRunnable 类实现了Runnable 接口)
|
||||||
Runnable worker = new MyRunnable("" + i);
|
Runnable worker = new MyRunnable("" + i);
|
||||||
//执行Runnable
|
//执行Runnable
|
||||||
executor.execute(worker);
|
executor.execute(worker);
|
||||||
@ -631,4 +631,4 @@ CompletableFuture<Void> allFutures = CompletableFuture.allOf(
|
|||||||
- 《深入理解 Java 虚拟机》
|
- 《深入理解 Java 虚拟机》
|
||||||
- 《实战 Java 高并发程序设计》
|
- 《实战 Java 高并发程序设计》
|
||||||
- Java并发之AQS详解:https://www.cnblogs.com/waterystone/p/4920797.html
|
- Java并发之AQS详解:https://www.cnblogs.com/waterystone/p/4920797.html
|
||||||
- Java并发包基石-AQS详解:https://www.cnblogs.com/chengxiao/archive/2017/07/24/7141160.html
|
- Java并发包基石-AQS详解:https://www.cnblogs.com/chengxiao/archive/2017/07/24/7141160.html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user