Phase 1 Language Basics + Advanced _1-3-Java language senior _05- abnormal and multi-threaded _ Section 3 _6_ thread synchronization mechanism to address security thread synchronization method _









Here output about this subject

here and then print run. Look at and this is not the same object



so the synchronization object is the default object using the current thread object.

The sunchrized method body of the comment. Then the following method this object locking member. If you can guarantee the safety it shows this is the only


result output can also be unique

 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11260541.html