Revert "Fix statistics race condition on big flows"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / registry / group / DeviceGroupRegistryImpl.java
index 1154f56bb3101de33debe247f963b892f93e19cf..1698929974f1474a0c248be6a816618aa15ded7f 100644 (file)
@@ -33,7 +33,24 @@ public class DeviceGroupRegistryImpl implements DeviceGroupRegistry {
 
     @Override
     public void removeMarked() {
-        groupIdList.removeAll(marks);
+        synchronized (groupIdList) {
+            groupIdList.removeAll(marks);
+        }
         marks.clear();
     }
+
+    @Override
+    public List<GroupId> getAllGroupIds() {
+        return groupIdList;
+    }
+
+    @Override
+    public void close() {
+        synchronized (groupIdList) {
+            groupIdList.clear();
+        }
+        synchronized (marks) {
+            marks.clear();
+        }
+    }
 }