public virtual bool Put(FacetLabel categoryPath, int ordinal) { lock (this) { bool ret = cache.Put(categoryPath, ordinal); // If the cache is full, we need to clear one or more old entries // from the cache. However, if we delete from the cache a recent // addition that isn't yet in our reader, for this entry to be // visible to us we need to make sure that the changes have been // committed and we reopen the reader. Because this is a slow // operation, we don't delete entries one-by-one but rather in bulk // (put() removes the 2/3rd oldest entries). if (ret) { cache.MakeRoomLRU(); } return(ret); } }