と同じシンクロ効果(?)だとして、class C { int x = 0; synchronized public void add(int i) { x += i; foo(x); } }
なんてのが載ってたらしくて。class C { Integer x = new Integer(0); public void add(int i) { synchronized(x) { x = new Integer(x.intValue() + i); foo(x.intValue()); } } }