File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/main/java/com/github/shyiko/mysql/binlog Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1175,13 +1175,16 @@ public void disconnect() throws IOException {
11751175 }
11761176
11771177 private void terminateKeepAliveThread () {
1178- keepAliveThreadExecutorLock .lock ();
1179- ExecutorService keepAliveThreadExecutor = this .keepAliveThreadExecutor ;
1180- if (keepAliveThreadExecutor == null ) {
1181- return ;
1178+ try {
1179+ keepAliveThreadExecutorLock .lock ();
1180+ ExecutorService keepAliveThreadExecutor = this .keepAliveThreadExecutor ;
1181+ if ( keepAliveThreadExecutor == null ) {
1182+ return ;
1183+ }
1184+ keepAliveThreadExecutor .shutdownNow ();
1185+ } finally {
1186+ keepAliveThreadExecutorLock .unlock ();
11821187 }
1183- keepAliveThreadExecutor .shutdownNow ();
1184- keepAliveThreadExecutorLock .unlock ();
11851188 while (!awaitTerminationInterruptibly (keepAliveThreadExecutor ,
11861189 Long .MAX_VALUE , TimeUnit .NANOSECONDS )) {
11871190 // ignore
You can’t perform that action at this time.
0 commit comments