为了账号安全,请及时绑定邮箱和手机立即绑定

java.util.concurrent.atomic.AtomicInteger

java.util.concurrent.atomic.AtomicInteger

慕桂英4014372 2018-07-15 07:04:42
public final int decrementAndGet() {        for (;;) {                   // for (;;) 这样写是为什么  有什么好处            int current = get();            int next = current - 1;            if (compareAndSet(current, next))                return next;        }    }
查看完整描述

1 回答

?
翻阅古今

TA贡献1780条经验 获得超5个赞

就是不停的重试,和while(true)没啥区别

查看完整回答
反对 回复 2018-07-15
  • 1 回答
  • 0 关注
  • 519 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信