- 博客(2)
- 收藏
- 关注
原创 可重入锁ReentrantLock,lock/unlock源码解读
我们知道可重入锁,是指当前线程加锁的对象,本线程可以再次访问。ReentrantLock 和synchronized 都是 可重入锁。看下Doug Lea大神写的注释:* <p>A {@code ReentrantLock} is <em>owned</em> by the thread last* successfully locking, but not ...
2018-06-26 18:23:59 916
原创 HashMap put返回Null的问题
今早一过来就遇到一个bug,result.setData数据没写入成功,具体代码如下:result.setData(new HashMap<>().put("stepType",stepType));debug后发现data中的数据是null;查hashMap源码:public HashMap() { this.loadFactor = DEFAULT_LOAD_FACTOR;...
2018-05-22 11:17:19 3819
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人