Skip to content

Commit 22bf7c9

Browse files
committed
add missed while
1 parent cccd36b commit 22bf7c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MD/Threadcore.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ Java 中可以使用 `volatile` 来保证顺序性,`synchronized 和 lock` 也
121121
new Thread(new Runnable() {
122122
@Override
123123
public void run() {
124-
doSomeThing();
124+
while (flag) {
125+
doSomeThing();
126+
}
125127
}
126128
});
127129
}

0 commit comments

Comments
 (0)