ConnectionPool
|---------------------------|
| |
getConnection | |
(notEmpty.await) | |
(lowWater.signal) | |
(maxActive.await) | |
<-------------------------- | |
<-------------------------- | |
<-------------------------- | |
| |
| |
--------------------------> | |
--------------------------> | | 销毁多余连接的线程
--------------------------> | | (highWater.await, idleTimeout.await)
close | | -------------------------------------->
(highWater.signal) | |
(maxActive.signal) | |
| |
| |
产生连接的线程 | |
(lowWater.await) | |
(notEmpty.signal) | |
--------------------------> | |
| |
|---------------------------|
五个Condition:notEmpty、maxActive、lowWater、highWater, idleTime