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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to