[GitHub] activemq-artemis issue #2481: ARTEMIS-2213 don't expire critical component i...
Github user wy96f commented on the issue:
We add a pending counter to count enterCritical calls. If left time is less than enter time and pending counter equals to 0, we don't expire component as all threads have called leaveCritical and it maybe caused by clock drift.
When a clock jumps backwards, to avoid the edge case that enterCritical is called during isExpired, we need to compare current time to latest timeEnter.