clebertsuconic commented on code in PR #4101:
URL: https://github.com/apache/activemq-artemis/pull/4101#discussion_r895739505
##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounterUtil.java:
##########
@@ -61,24 +63,31 @@ public Runnable getTask() {
@Override
public int increment() {
- return uses.incrementAndGet();
+ return useUpdater.incrementAndGet(this);
}
@Override
public int decrement() {
- int value = uses.decrementAndGet();
+ int value = useUpdater.decrementAndGet(this);
if (value == 0) {
execute();
}
return value;
}
+ public void reset() {
+ execute();
Review Comment:
I probably need a better name then... exhaust?
this method will consume all the credits and take to execute right away
(that would happen when value == 0 on the referenceCounting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]