Skip to content

Commit

Permalink
Lucene.Net.Search.SearcherLifetimeManager: Added comment to indicate …
Browse files Browse the repository at this point in the history
…the reason we use Lazy<T> is to make the create operation atomic. See #417.
  • Loading branch information
NightOwl888 committed Mar 14, 2021
1 parent 1ebfcad commit 91732bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Lucene.Net/Search/SearcherLifetimeManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lucene.Net.Support;
using Lucene.Net.Support;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down Expand Up @@ -139,6 +139,7 @@ public void Dispose()
// TODO: we could get by w/ just a "set"; need to have
// Tracker hash by its version and have compareTo(Long)
// compare to its version
// LUCENENET specific - use Lazy<T> to make the create operation atomic. See #417.
private readonly ConcurrentDictionary<long, Lazy<SearcherTracker>> _searchers = new ConcurrentDictionary<long, Lazy<SearcherTracker>>();

private void EnsureOpen()
Expand Down

0 comments on commit 91732bc

Please sign in to comment.