paulirwin commented on code in PR #938:
URL: https://github.com/apache/lucenenet/pull/938#discussion_r1602506978


##########
src/Lucene.Net/Support/ConcurrentHashSet.cs:
##########
@@ -753,7 +753,16 @@ private void CopyToItems(T[] array, int index)
 
         public void ExceptWith(IEnumerable<T> other)
         {
-            throw new NotImplementedException();
+            if (ReferenceEquals(this, other))

Review Comment:
   Pushed up a change that uses UninterruptableMonitor around a new lock object 
instead of using ConcurrentHashSet, to avoid the race conditions. 
ConcurrentHashSet becomes redundant here in that case. Since the hashset field 
is protected, I added some documentation to the fields explaining that any 
derived types that need to access them should lock on syncLock before accessing 
`m_staleFiles`.
   
   Also, what is our stance on field naming? Should we change `m_staleFiles` 
back to match Lucene's `staleFiles`? It doesn't seem to be consistent 
throughout the app. I personally would prefer to match Lucene, but let me know 
your thoughts. Renaming a protected field is a breaking change, so we should do 
that now if we're going to do it.



-- 
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]

Reply via email to