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

    https://github.com/apache/brooklyn-server/pull/96#discussion_r58194087
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java ---
    @@ -1548,7 +1550,7 @@ public boolean unsubscribe(Entity producer, 
SubscriptionHandle handle) {
          * @deprecated since 0.9.0; for internal use only
          */
         @Deprecated
    -    protected synchronized SubscriptionTracker getSubscriptionTracker() {
    +    protected SubscriptionTracker getSubscriptionTracker() {
    --- End diff --
    
    I've added another commit that does the `getSubscriptionContext()` call 
outside of the synchronized block - just in case there are any problems I 
haven't thought of there!
    
    I didn't bother with double-checked locking and volatile field. If we care 
hugely about performance here, then we should instantiate it on entity 
initialisation (before this method is called), and get rid of all the 
synchronization in the method. That would be a simpler concurrency model. But 
it's a bit fiddly because of the use `EntityManagementSupport` (and its lazy 
initialisation, and use of `NonDeploymentManagementContext` on construction).


---
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