Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything inside a class.

When you synchronize (statement) it is locking and then unlocking a mutex. A class has a mutex, simple! It only prevent multiple threads modifying a single thing at specific times, thats all.

Reply via email to