Skip to content

Commit 8b4f303

Browse files
committed
fix: delete synchronized
1 parent bb5702e commit 8b4f303

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/apache/ibatis/datasource/pooled/PooledDataSource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public int getPoolPingConnectionsNotUsedFor() {
332332
*/
333333
public void forceCloseAll() {
334334
fairLock.lock();
335-
synchronized (state) {
335+
try {
336336
expectedConnectionTypeCode = assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());
337337
for (int i = state.activeConnections.size(); i > 0; i--) {
338338
try {
@@ -362,6 +362,10 @@ public void forceCloseAll() {
362362
// ignore
363363
}
364364
}
365+
} finally {
366+
if (fairLock.isLocked()) {
367+
fairLock.unlock();
368+
}
365369
}
366370
if (log.isDebugEnabled()) {
367371
log.debug("PooledDataSource forcefully closed/removed all connections.");

0 commit comments

Comments
 (0)