// @topic T11768 Multithreading -- wait-notify-interrupt example 02
// @brief class SynchronizedCounter -- a shared resource between threads

package mth;

public class SynchronizedCounter {
    private int value = 0;

    public
        synchronized
        void increment() {
            ++value;
        }

    public
        synchronized
        void decrement() {
            --value;
        }

    public
        synchronized
        int getValue() {
            return value;
        }
}//class SynchronizedCounter