File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments