paulirwin commented on code in PR #1096: URL: https://github.com/apache/lucenenet/pull/1096#discussion_r1912491137
########## src/Lucene.Net.TestFramework/Support/Util/LifecycleScope.cs: ########## @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lucene.Net.Util +{ Review Comment: Need license header, right? ########## src/Lucene.Net.TestFramework/Support/Util/RandomizedContext.cs: ########## @@ -37,6 +40,12 @@ internal class RandomizedContext private readonly long randomSeed; private readonly string randomSeedAsHex; private readonly long testSeed; + private List<IDisposable>? toDisposeAtEnd = null; Review Comment: Thoughts on using `Lazy<ConcurrentBag<IDisposable>>` here with one of the thread-safe constructor options? That would remove the need for the locking. I would imagine in this case we don't need to worry about the "uninterruptible"-ness, but let me know if we do. I also suggest `ConcurrentBag` in the case that the order doesn't matter, but if it does, we might need to think about using `ConcurrentStack` instead, because you might want it to go in opposite order for disposal. Or `ConcurrentQueue` would allow for insertion-order disposal. -- 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-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org