Skip to content

Commit d8f7a7b

Browse files
author
Justin Lin
committed
added missing code
1 parent 0a4fc7d commit d8f7a7b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

example/CH15/SomeThread.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
public class SomeThread implements Runnable {
44
public void run() {
55
System.out.println("sleep....至 blocked 狀態");
6-
try {
7-
Thread.sleep(9999);
8-
}
9-
catch(InterruptedException e) {
10-
System.out.println("I am interrupted....");
11-
}
6+
while(true) {
7+
try {
8+
Thread.sleep(9999);
9+
}
10+
catch(InterruptedException e) {
11+
System.out.println("I am interrupted....");
12+
}
13+
}
1214
}
1315

1416
public static void main(String[] args) {

0 commit comments

Comments
 (0)