@@ -0,0 +1,1756 @@
+package org.lxp.mutiple.thread;%0A%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0A/**%0A * @Description: %E6%B5%8B%E8%AF%95AtomicInteger%0A * @author Super.Li%0A * @since Sep 17, 2017%0A */%0Apublic class AtomicIntegerTest %7B%0A    private static AtomicInteger num = new AtomicInteger(0);%0A%0A    public static void main(String%5B%5D args) %7B%0A        MyThead thread0 = new MyThead(1);%0A        MyThead thread1 = new MyThead(0);%0A        thread0.start();%0A        thread1.start();%0A    %7D%0A%0A    public static class MyThead extends Thread %7B%0A%0A        private int v;%0A%0A        public MyThead(int v) %7B%0A            this.v = v;%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            synchronized (num) %7B%0A                while (num.get() %3C 100) %7B%0A                    if (v == 1) %7B%0A                        if (num.get() %25 2 == 0) %7B%0A                            try %7B%0A                                num.wait();%0A                            %7D catch (InterruptedException e) %7B%0A                                e.printStackTrace();%0A                            %7D%0A                        %7D else %7B%0A                            System.out.println(num.incrementAndGet());%0A                            num.notifyAll();%0A                        %7D%0A                    %7D else if (v == 0) %7B%0A                        if (num.get() %25 2 == 1) %7B%0A                            try %7B%0A                                num.wait();%0A                            %7D catch (InterruptedException e) %7B%0A                                e.printStackTrace();%0A                            %7D%0A                        %7D else %7B%0A                            System.out.println(num.incrementAndGet());%0A                            num.notifyAll();%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

add AtomicInteger test