예제 Counter.java package org.example.atomic; public class Counter { private int c = 0; public void increment() { c++; } public void decrement() { c--; } public int value() { return c; } } 위 예제는 멀티 스레드에서 접근하는 요청에 대한 정합성 확보가 어렵다는 문제점이 있다. 이를 해결하기 위해 각 메서드에 synchronized 키워드를 붙여 객체에 록을 걸어보자. SynchronizedCounter.java package org.example.atomic; public class SynchronizedCounter { private int c = 0; pub..