You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by GitBox <gi...@apache.org> on 2021/07/22 09:05:20 UTC

[GitHub] [felix-dev] amitjoy commented on a change in pull request #81: [FELIX-6439] Removed use of 'TreeMap' in concurrent environment

amitjoy commented on a change in pull request #81:
URL: https://github.com/apache/felix-dev/pull/81#discussion_r674623250



##########
File path: scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
##########
@@ -328,7 +328,7 @@ public void dispose()
 
     private Map<RefPair<?, ?>, Object> createNewFieldHandlerMap()
     {
-        return new TreeMap<>(
+        return new ConcurrentSkipListMap<>(

Review comment:
       @tjwatson According to the current implementation, `org.apache.felix.scr.impl.inject.field.FieldHandler.updateField(METHOD_TYPE, Object, BindParameters)` will be invoked by different implementations of `org.apache.felix.scr.impl.inject.field.FieldHandler.State.invoke(FieldHandler, METHOD_TYPE, Object, BindParameters)` and if we traverse back, none of the consumers of the aforementioned `invoke(..)` method is thread-safe (synchronized). I agree with you, we should introduce thread-safety in `org.apache.felix.scr.impl.inject.field.FieldHandler.updateField(METHOD_TYPE, Object, BindParameters)`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org