Once an item is accessed in the LRU cache is there a way to make it invalid for access by subsequent requests? The use case is like:
1. I want to access an element from the LRU cache.
2. Use the accessed element and while in use this should not be accessible to other threads.
3. Return the used item to the LRU cache which makes the item available for future requests.
Currently I am not sure how to do Step 2. It is not necessary that I use a LRU cache data structure, maybe there is some other data structure which can help me do this. Any help is appreciated.