Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/771#discussion_r35631925
  
    --- Diff: 
software/base/src/test/java/brooklyn/entity/basic/SoftwareProcessEntityTest.java
 ---
    @@ -568,4 +706,85 @@ protected String getInstallLabelExtraSalt() {
                 return 
(String)getEntity().getConfigRaw(ConfigKeys.newStringConfigKey("salt"), 
true).or((String)null);
             }
         }
    +
    +    public static class ReleaseLatchLocation extends SimulatedLocation {
    +        private static final long serialVersionUID = 1L;
    +        
    +        private AtomicBoolean lock = new AtomicBoolean();
    +        private boolean isBlocked;
    +
    +        public void unblock() {
    +            synchronized (lock) {
    --- End diff --
    
    Given it's for a test, I don't really care but...
    
    I much prefer using higher-level synchronization utils from 
java.util.concurrent whenever possible, rather than synchronize.
    An object.wait() can wake up prematurely, which is why one should always 
wrap it in a while block rather than an if block.



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to