incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1563904 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java
Date Mon, 03 Feb 2014 14:10:57 GMT
Author: stefanegli
Date: Mon Feb  3 14:10:57 2014
New Revision: 1563904

URL: http://svn.apache.org/r1563904
Log:
SLING-3365 : dont use synchronized on deactivate but use volatile activated instead

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java?rev=1563904&r1=1563903&r2=1563904&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/common/heartbeat/HeartbeatHandler.java
Mon Feb  3 14:10:57 2014
@@ -113,7 +113,7 @@ public class HeartbeatHandler implements
     private Calendar lastHeartbeatWritten = null;
     
     /** SLING-2895: avoid heartbeats after deactivation **/
-    private boolean activated = false;
+    private volatile boolean activated = false;
     
     /** SLING-2901: the runtimeId is a unique id, set on activation, used for robust duplicate
sling.id detection **/
     private String runtimeId;
@@ -165,9 +165,8 @@ public class HeartbeatHandler implements
 
     @Deactivate
     protected void deactivate() {
-    	synchronized(lock) {
-	    	activated = false;
-    	}
+        // SLING-3365 : dont synchronize on deactivate
+        activated = false;
     	scheduler.removeJob(NAME);
     }
 



Mime
View raw message