Permalink
Browse files

more human reader friendly updateStabilityState() method

  • Loading branch information...
ropalka committed Feb 11, 2013
1 parent c0c2727 commit 61da841a3924eca77ebf030c0a209062fc2c5f10
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/org/jboss/msc/service/ServiceControllerImpl.java
@@ -353,15 +353,16 @@ boolean isStableRestState() {
void updateStabilityState(final boolean leavingStableRestState) {
assert holdsLock(this);
+ final boolean enteringStableRestState = state.isRestState() && asyncTasks == 0;
if (leavingStableRestState) {
- if (asyncTasks > 0 || !state.isRestState()) {
+ if (!enteringStableRestState) {
primaryRegistration.getContainer().incrementUnstableServices();
for (StabilityMonitor monitor : monitors) {
monitor.incrementUnstableServices();
}
}
} else {
- if (state.isRestState() && asyncTasks == 0) {
+ if (enteringStableRestState) {
primaryRegistration.getContainer().decrementUnstableServices();
for (StabilityMonitor monitor : monitors) {
monitor.decrementUnstableServices();

0 comments on commit 61da841

Please sign in to comment.