Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1477#discussion_r134461348
--- Diff:
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
---
@@ -159,7 +158,11 @@
private final boolean direct;
- private static final ThreadLocal<AtomicBoolean> inHandler =
ThreadLocal.withInitial(AtomicBoolean::new);
+ //marker instance used to recognize if a thread is performing a packet
handling
+ private static final Object DUMMY = Boolean.TRUE;
+
+ //a thread that has its thread-local map populated with DUMMY is
performing a packet handling
+ private static final ThreadLocal<Object> inHandler = new
ThreadLocal<>();
--- End diff --
Because it is not needed to be a Boolean: it is just a marker, so even a
DUMMY = new Object() could be used instead of Boolean to make it works.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---