我遇到了一个疑问,如果下面是线程安全的,
// is this thread safe, final int MAX_COUNT = 3 ?
if (retryCount.get() < MAX_COUNT) {
// some other code
retryCount.getAndIncrement();
} else {
// reset count & some other code
retryCount.set(0);
}
上面的条件检查线程安全吗?