项目垃圾桶

功能性:

业务+需求+测试

非功能性:

稳定,规范,监控,预警,补偿

利用cas 实现原子递增和递减的操作。

    public final long incrementAndGet() {
    for (;;) {
        long current = get();
        long next = current + 1;
        if (compareAndSet(current, next))
            return next;
    }
}

转载于:https://www.cnblogs.com/bnbqian/p/5261711.html

你可能感兴趣的:(项目垃圾桶)