Skip to content

Commit 0a4fc7d

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

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/CH15.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,14 @@ package onlyfun.caterpillar;
424424
public class SomeThread implements Runnable {
425425
public void run() {
426426
System.out.println("sleep....至 blocked 狀態");
427-
try {
428-
Thread.sleep(9999);
429-
}
430-
catch(InterruptedException e) {
431-
System.out.println("I am interrupted....");
432-
}
427+
while(true) {
428+
try {
429+
Thread.sleep(9999);
430+
}
431+
catch(InterruptedException e) {
432+
System.out.println("I am interrupted....");
433+
}
434+
}
433435
}
434436

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

0 commit comments

Comments
 (0)