Well. I read your code. The problem is that you depend on how Java chooses
one of waiting threads (to enter monitor) when it receives a notify()
signal; The thing thats is prohibited in Java.
Its is interesting that on JDK 1.5 is seems to work correctly as is (i.e.
increment/decrements by 1) but in JDK 1.6 step changes to 2. This
clarifies that they have different thread/monitor entrance policy.