You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/12/19 08:55:24 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #3379: [NETBEANS-6312] Assure that TokenHierarchy is called with Document's read lock.

sdedic commented on a change in pull request #3379:
URL: https://github.com/apache/netbeans/pull/3379#discussion_r771918025



##########
File path: ide/editor.util/src/org/netbeans/lib/editor/util/swing/DocumentUtilities.java
##########
@@ -65,9 +65,9 @@
     
     private static final Object TYPING_MODIFICATION_KEY = new Object();
     
-    private static Field numReadersField;
+    private static volatile Field numReadersField;

Review comment:
       BTW is this necessary, strictly speaking ? The `nuimReadersField` may be eventually initialized several times (a thread that was already started at the time of the previous assignment could see `null`) - but the Field instance should point to the same data (?).  But bcs of number of invocations (and other heavy locking on Document) I guess it makes no difference between volatile/nonvolatile.




-- 
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: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists