多条语句对共性数据进行操作的部分包起来 使用synchronize (){}方法 创建一个锁对象 使多条线程都走该对象(锁) 转载于:https://www.cnblogs.com/HufeYao/p/10365107.html