I want to understand how locking is done on static methods in Java.
let\'s say I have the following class:
class Foo {
private static int bar = 0
These two calls do not synchronize in respect to each other.
It is as you said, a caller of f.get() acquires the lock of f object and caller of Foo.inc() acquires Foo.class object's one. So the synchronization rules are the same as if instead of static call you called an instance synchronized method with another object.