摘要: 1. 懒汉双重检验 1 public class DubbleSingleton { 2 3 private static DubbleSingleton ds; 4 5 public static DubbleSingleton getDs(){ 6 if(ds == null){ 7 try { 阅读全文
posted @ 2017-12-02 10:09 黑土白云 阅读(161) 评论(0) 推荐(0)
摘要: 1. 1 public class ConnThreadLocal { 2 3 //线程变量副本,每个线程都有一个,所以多线程的时候,就不会出现覆盖.而是每个线程一个 4 public static ThreadLocal<String> th = new ThreadLocal<String>() 阅读全文
posted @ 2017-12-02 10:05 黑土白云 阅读(203) 评论(0) 推荐(0)