sofa-bolt
sofa-bolt copied to clipboard
DefaultConnectionManager#getConnectionPoolAndCreateIfAbsent
在com.alipay.remoting.DefaultConnectionManager#getConnectionPoolAndCreateIfAbsent方法中:
RunStateRecordedFutureTask<ConnectionPool> initialTask; initialTask是FutureTask类型,为什么直接用run方法执行?
还有 initialTask = this.connTasks.get(poolKey); 如果非空直接跳到 pool = initialTask.get(); 不会一直阻塞吗?
initialTask是FutureTask类型,直接run是和get 配合的,为了创建连接池的无锁设计