Skip to content

Commit

Permalink
Merge PR #203: Handle System>>#exit: properly for async apps
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr authored Dec 18, 2017
2 parents 9bdd435 + ee6a79b commit 3589aff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/som/vm/ObjectSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private static void setSlot(final SObject obj, final String slotName,
private void handlePromiseResult(final SPromise promise) {
int emptyFJPool = 0;
while (emptyFJPool < 120) {
if (promise.isCompleted() || vm.shouldExit()) {
if (promise.isCompleted()) {
if (vm.isAvoidingExit()) {
return;
}
Expand All @@ -353,6 +353,13 @@ private void handlePromiseResult(final SPromise promise) {
}
}

if (vm.shouldExit()) {
if (vm.isAvoidingExit()) {
return;
}
vm.shutdownAndExit(vm.lastExitCode());
}

try {
Thread.sleep(500);
} catch (InterruptedException e) {}
Expand Down

0 comments on commit 3589aff

Please sign in to comment.