@@ -672,7 +672,7 @@ final boolean isLoggingPackets() {
672
672
int numMsgsSent = 0 ;
673
673
int numMsgsRcvd = 0 ;
674
674
675
- private final transient Lock lock = new ReentrantLock ();
675
+ private final transient Lock tdsChannelLock = new ReentrantLock ();
676
676
677
677
// Last SPID received from the server. Used for logging and to tag subsequent outgoing
678
678
// packets to facilitate diagnosing problems from the server side.
@@ -773,7 +773,7 @@ void disableSSL() {
773
773
logger .finer (toString () + " Disabling SSL..." );
774
774
}
775
775
776
- lock .lock ();
776
+ tdsChannelLock .lock ();
777
777
try {
778
778
// Guard in case of disableSSL being called before enableSSL
779
779
if (proxySocket == null ) {
@@ -839,7 +839,7 @@ void disableSSL() {
839
839
channelSocket = tcpSocket ;
840
840
sslSocket = null ;
841
841
} finally {
842
- lock .unlock ();
842
+ tdsChannelLock .unlock ();
843
843
}
844
844
845
845
if (logger .isLoggable (Level .FINER ))
@@ -1056,6 +1056,8 @@ private void writeInternal(byte[] b, int off, int len) throws IOException {
1056
1056
private final class ProxyInputStream extends InputStream {
1057
1057
private InputStream filteredStream ;
1058
1058
1059
+ private final transient Lock proxyInputStreamLock = new ReentrantLock ();
1060
+
1059
1061
/**
1060
1062
* Bytes that have been read by a poll(s).
1061
1063
*/
@@ -1082,7 +1084,7 @@ final void setFilteredStream(InputStream is) {
1082
1084
* If an I/O exception occurs.
1083
1085
*/
1084
1086
public boolean poll () {
1085
- lock .lock ();
1087
+ proxyInputStreamLock .lock ();
1086
1088
try {
1087
1089
int b ;
1088
1090
try {
@@ -1117,7 +1119,7 @@ public boolean poll() {
1117
1119
1118
1120
return true ;
1119
1121
} finally {
1120
- lock .unlock ();
1122
+ proxyInputStreamLock .unlock ();
1121
1123
}
1122
1124
}
1123
1125
@@ -1133,7 +1135,7 @@ private int getOneFromCache() {
1133
1135
1134
1136
@ Override
1135
1137
public long skip (long n ) throws IOException {
1136
- lock .lock ();
1138
+ proxyInputStreamLock .lock ();
1137
1139
try {
1138
1140
long bytesSkipped = 0 ;
1139
1141
@@ -1154,7 +1156,7 @@ public long skip(long n) throws IOException {
1154
1156
1155
1157
return bytesSkipped ;
1156
1158
} finally {
1157
- lock .unlock ();
1159
+ proxyInputStreamLock .unlock ();
1158
1160
}
1159
1161
}
1160
1162
@@ -1191,7 +1193,7 @@ public int read(byte[] b, int offset, int maxBytes) throws IOException {
1191
1193
}
1192
1194
1193
1195
private int readInternal (byte [] b , int offset , int maxBytes ) throws IOException {
1194
- lock .lock ();
1196
+ proxyInputStreamLock .lock ();
1195
1197
try {
1196
1198
int bytesRead ;
1197
1199
@@ -1240,7 +1242,7 @@ private int readInternal(byte[] b, int offset, int maxBytes) throws IOException
1240
1242
1241
1243
return bytesRead ;
1242
1244
} finally {
1243
- lock .unlock ();
1245
+ proxyInputStreamLock .unlock ();
1244
1246
}
1245
1247
}
1246
1248
@@ -1259,11 +1261,11 @@ public void mark(int readLimit) {
1259
1261
if (logger .isLoggable (Level .FINEST ))
1260
1262
logger .finest (super .toString () + " Marking next " + readLimit + " bytes" );
1261
1263
1262
- lock .lock ();
1264
+ proxyInputStreamLock .lock ();
1263
1265
try {
1264
1266
filteredStream .mark (readLimit );
1265
1267
} finally {
1266
- lock .unlock ();
1268
+ proxyInputStreamLock .unlock ();
1267
1269
}
1268
1270
}
1269
1271
@@ -1272,12 +1274,12 @@ public void reset() throws IOException {
1272
1274
if (logger .isLoggable (Level .FINEST ))
1273
1275
logger .finest (super .toString () + " Resetting to previous mark" );
1274
1276
1275
- lock .lock ();
1277
+ proxyInputStreamLock .lock ();
1276
1278
try {
1277
1279
1278
1280
filteredStream .reset ();
1279
1281
} finally {
1280
- lock .unlock ();
1282
+ proxyInputStreamLock .unlock ();
1281
1283
}
1282
1284
}
1283
1285
@@ -6688,7 +6690,7 @@ final SQLServerConnection getConnection() {
6688
6690
private boolean serverSupportsColumnEncryption = false ;
6689
6691
private boolean serverSupportsDataClassification = false ;
6690
6692
private byte serverSupportedDataClassificationVersion = TDS .DATA_CLASSIFICATION_NOT_ENABLED ;
6691
- private final transient Lock lock = new ReentrantLock ();
6693
+ private final transient Lock tdsReaderLock = new ReentrantLock ();
6692
6694
6693
6695
private final byte [] valueBytes = new byte [256 ];
6694
6696
@@ -6808,7 +6810,7 @@ private boolean nextPacket() throws SQLServerException {
6808
6810
* the response and another thread that is trying to buffer it with TDSCommand.detach().
6809
6811
*/
6810
6812
final boolean readPacket () throws SQLServerException {
6811
- lock .lock ();
6813
+ tdsReaderLock .lock ();
6812
6814
try {
6813
6815
if (null != command && !command .readingResponse ())
6814
6816
return false ;
@@ -6921,7 +6923,7 @@ final boolean readPacket() throws SQLServerException {
6921
6923
6922
6924
return true ;
6923
6925
} finally {
6924
- lock .unlock ();
6926
+ tdsReaderLock .unlock ();
6925
6927
}
6926
6928
}
6927
6929
0 commit comments