java.util.concurrent.atomic.AtomicInteger

public final int decrementAndGet() {
        for (;;) {                   // for (;;) 这样写是为什么  有什么好处
            int current = get();
            int next = current - 1;
            if (compareAndSet(current, next))
                return next;
        }
    }

慕桂英4014372
浏览 520回答 1
1回答

翻阅古今

就是不停的重试,和while(true)没啥区别
打开App,查看更多内容
随时随地看视频慕课网APP