Spring bean:解决线程安全问题的总结

一、避免使用类成员变量。
二、加锁
三、使用ThreadLocal成员变量
四、使用prototype bean

猜你喜欢

转载自blog.csdn.net/amadeus_liu2/article/details/133454534