Static versus non-static lock object in synchronized block
The difference is simple: if the locked-on object is in a static field, then all instances of MyClass* will share that lock (i.e. no two objects will be able to lock on that object at the same time). If the field is non-static, then each instance will have its own lock, so only calls of … Read more