Skip to content

Commit

Permalink
[MSC-128] fix missing stability notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ropalka committed Feb 11, 2013
1 parent 61da841 commit 2133c22
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/main/java/org/jboss/msc/service/ServiceControllerImpl.java
Expand Up @@ -2009,10 +2009,14 @@ private class StopTask implements Runnable {
StopTask(final boolean onlyUninject) {
this.onlyUninject = onlyUninject;
if (!onlyUninject && !ServiceControllerImpl.this.children.isEmpty()) {
this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
// placeholder async task for child removal; last removed child will decrement this count
// see removeChild method to verify when this count is decremented
ServiceControllerImpl.this.asyncTasks ++;
synchronized (ServiceControllerImpl.this) {
final boolean leavingRestState = isStableRestState();
this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
// placeholder async task for child removal; last removed child will decrement this count
// see removeChild method to verify when this count is decremented
ServiceControllerImpl.this.asyncTasks ++;
updateStabilityState(leavingRestState);
}
}
else {
this.children = null;
Expand Down Expand Up @@ -2192,10 +2196,14 @@ private class DependencyFailedTask implements Runnable {
DependencyFailedTask(final Dependent[][] dependents, final boolean removeChildren) {
this.dependents = dependents;
if (removeChildren && !ServiceControllerImpl.this.children.isEmpty()) {
this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
// placeholder async task for child removal; last removed child will decrement this count
// see removeChild method to verify when this count is decremented
ServiceControllerImpl.this.asyncTasks ++;
synchronized (ServiceControllerImpl.this) {
final boolean leavingRestState = isStableRestState();
this.children = ServiceControllerImpl.this.children.toScatteredArray(NO_CONTROLLERS);
// placeholder async task for child removal; last removed child will decrement this count
// see removeChild method to verify when this count is decremented
ServiceControllerImpl.this.asyncTasks ++;
updateStabilityState(leavingRestState);
}
}
else {
this.children = null;
Expand Down

0 comments on commit 2133c22

Please sign in to comment.