Skip to content

Commit 0364454

Browse files
author
liangyi
committed
fix: 修改VolatileAtomicityDemo中的笔误
1 parent 74ccdbc commit 0364454

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/java/concurrent/java-concurrent-questions-02.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class Singleton {
9696
* @author Guide哥
9797
* @date 2022/08/03 13:40
9898
**/
99-
public class VolatoleAtomicityDemo {
99+
public class VolatileAtomicityDemo {
100100
public volatile static int inc = 0;
101101

102102
public void increase() {
@@ -105,11 +105,11 @@ public class VolatoleAtomicityDemo {
105105

106106
public static void main(String[] args) throws InterruptedException {
107107
ExecutorService threadPool = Executors.newFixedThreadPool(5);
108-
VolatoleAtomicityDemo volatoleAtomicityDemo = new VolatoleAtomicityDemo();
108+
VolatileAtomicityDemo volatileAtomicityDemo = new VolatileAtomicityDemo();
109109
for (int i = 0; i < 5; i++) {
110110
threadPool.execute(() -> {
111111
for (int j = 0; j < 500; j++) {
112-
volatoleAtomicityDemo.increase();
112+
volatileAtomicityDemo.increase();
113113
}
114114
});
115115
}

0 commit comments

Comments
 (0)