You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2017/11/30 09:04:35 UTC

svn commit: r1816694 - /felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java

Author: cziegeler
Date: Thu Nov 30 09:04:34 2017
New Revision: 1816694

URL: http://svn.apache.org/viewvc?rev=1816694&view=rev
Log:
Fixed a sync problem related to the change count

Modified:
    felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java

Modified: felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java?rev=1816694&r1=1816693&r2=1816694&view=diff
==============================================================================
--- felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java (original)
+++ felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java Thu Nov 30 09:04:34 2017
@@ -720,23 +720,23 @@ public class ComponentRegistry
                 {
                     this.timer = new Timer();
                 }
-            }
-            timer.schedule(new TimerTask()
-            {
+                timer.schedule(new TimerTask()
+                {
 
-                @Override
-                public void run() {
-                    synchronized ( changeCountLock )
-                    {
-                        if ( changeCount == count )
+                    @Override
+                    public void run() {
+                        synchronized ( changeCountLock )
                         {
-                            registration.setProperties(getServiceRegistrationProperties());
-                            timer.cancel();
-                            timer = null;
+                            if ( changeCount == count )
+                            {
+                                registration.setProperties(getServiceRegistrationProperties());
+                                timer.cancel();
+                                timer = null;
+                            }
                         }
                     }
-                }
-            }, 5000L);
+                }, 5000L);
+            }
         }
     }
 }