brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Don't leak machines on shutdown
Date Tue, 28 Jul 2015 10:03:15 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/771#discussion_r35632009
  
    --- Diff: usage/cli/src/main/java/brooklyn/cli/Main.java ---
    @@ -964,4 +979,35 @@ public ToStringHelper string() {
         protected Class<? extends BrooklynCommand> cliDefaultInfoCommand() {
             return DefaultInfoCommand.class;
         }
    +    
    +    public static class AppShutdownRequestListener implements ShutdownRequestListener
{
    +        private AtomicBoolean mutex = new AtomicBoolean();
    +
    +        @Override
    +        public void onShutdownRequest() {
    +            synchronized (mutex) {
    --- End diff --
    
    I prefer use of CountDownLatch - slightly simpler code, which is always good when dealing
with multi-threading.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message