随笔分类 -  java并发

摘要:线程池中,常见有涉及到的: ExecutorService executorService = Executors.newSingleThreadExecutor(); ExecutorService executorService1 = Executors.newCachedThreadPool( 阅读全文
posted @ 2020-05-09 22:41 护花使者 阅读(488) 评论(0) 推荐(0)
摘要:(1)synchronized(myclass-class)用于静态方法中 static void myMethod() { synchronized(MyClass.class) { //code } } 注:静态方法中只能用synchronized(MyClass.class),不能用synch 阅读全文
posted @ 2019-12-28 22:35 护花使者 阅读(398) 评论(0) 推荐(0)