Skip to content

Commit d39d9b4

Browse files
committed
Use Lock interface to declare properties
Not ReentrantLock. References #1119 (cherry picked from commit 3f72657)
1 parent c393749 commit d39d9b4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/main/java/com/rabbitmq/client/impl/AMQChannel.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.concurrent.CompletableFuture;
3333
import java.util.concurrent.TimeoutException;
3434
import java.util.concurrent.locks.Condition;
35+
import java.util.concurrent.locks.Lock;
3536
import java.util.concurrent.locks.ReentrantLock;
3637
import java.util.function.Supplier;
3738

@@ -56,7 +57,7 @@ public abstract class AMQChannel extends ShutdownNotifierComponent {
5657
* so that clients can themselves use the channel to synchronize
5758
* on.
5859
*/
59-
protected final ReentrantLock _channelLock = new ReentrantLock();
60+
protected final Lock _channelLock = new ReentrantLock();
6061
protected final Condition _channelLockCondition = _channelLock.newCondition();
6162

6263
/** The connection this channel is associated with. */

src/main/java/com/rabbitmq/client/impl/AMQCommand.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.ByteArrayOutputStream;
1919
import java.io.DataOutputStream;
2020
import java.io.IOException;
21+
import java.util.concurrent.locks.Lock;
2122
import java.util.concurrent.locks.ReentrantLock;
2223

2324
import com.rabbitmq.client.AMQP;
@@ -44,7 +45,7 @@ public class AMQCommand implements Command {
4445

4546
/** The assembler for this command - synchronised on - contains all the state */
4647
private final CommandAssembler assembler;
47-
private final ReentrantLock assemblerLock = new ReentrantLock();
48+
private final Lock assemblerLock = new ReentrantLock();
4849

4950
AMQCommand(int maxBodyLength) {
5051
this(null, null, null, maxBodyLength);

src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.util.concurrent.ExecutorService;
3030
import java.util.concurrent.Future;
3131
import java.util.concurrent.TimeUnit;
32+
import java.util.concurrent.locks.Lock;
3233
import java.util.concurrent.locks.ReentrantLock;
3334

3435
/**
@@ -49,11 +50,11 @@ public class SocketFrameHandler implements FrameHandler {
4950

5051
/** Socket's inputstream - data from the broker - synchronized on */
5152
private final DataInputStream _inputStream;
52-
private final ReentrantLock _inputStreamLock = new ReentrantLock();
53+
private final Lock _inputStreamLock = new ReentrantLock();
5354

5455
/** Socket's outputstream - data to the broker - synchronized on */
5556
private final DataOutputStream _outputStream;
56-
private final ReentrantLock _outputStreamLock = new ReentrantLock();
57+
private final Lock _outputStreamLock = new ReentrantLock();
5758

5859
private final int maxInboundMessageBodySize;
5960

0 commit comments

Comments
 (0)