Java concurrent programming
1 Concurrent keywords
1.1 synchronized
1.1.1 The role of synchronized?
The synchronized keyword is used to control thread synchronization and avoid thread safety issues in a concurrent environment.
1.1.2 The use of synchronized?
Modify the instance method and lock the instance object.
Modify static methods and lock the class object.
Decorate the code block and lock the specified object.