Skip to content

Commit

Permalink
Remove wildcard import
Browse files Browse the repository at this point in the history
  • Loading branch information
denis.plotnikov committed Sep 30, 2024
1 parent 327d4ed commit bf4f626
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/main/java/com/exactpro/th2/FixHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@
import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -446,21 +452,22 @@ public CompletableFuture<MessageID> send(@NotNull ByteBuf body, @NotNull Map<Str
}
}

try {
communicationLock.lock();

if(strategy.getAllowMessagesBeforeRetransmissionFinishes()) {
if(strategy.getAllowMessagesBeforeRetransmissionFinishes()) {
try {
communicationLock.lock();
return strategy.getSendStrategy(SendStrategy::getSendHandler).send(channel, body, properties, eventID);
} else {
try {
recoveryLock.lock();
return strategy.getSendStrategy(SendStrategy::getSendHandler).send(channel, body, properties, eventID);
} finally {
recoveryLock.unlock();
}
} finally {
communicationLock.unlock();
}
} else {
try {
recoveryLock.lock();
communicationLock.lock();
return strategy.getSendStrategy(SendStrategy::getSendHandler).send(channel, body, properties, eventID);
} finally {
communicationLock.unlock();
recoveryLock.unlock();
}
} finally {
communicationLock.unlock();
}
}

Expand Down

0 comments on commit bf4f626

Please sign in to comment.