- You have put the entire
get()andput()methods inside a shared lock. Two threads cannot use this LRU cache in parallel. - You can define
DDLNodeas a record. Then its instances will be immutable and its members will be public by default.
get() and put() methods inside a shared lock. Two threads cannot use this LRU cache in parallel.DDLNode as a record. Then its instances will be immutable and its members will be public by default.