What would you (or anyone) want to achieve with this? ConcurrentHashMapalready thread safe as it is. Wrapping with an additional lock code will significantly reduce it, since
- he doesnโt record reading as such,
- , .
, ( , ).
ConcurrentHashMap ConcurrentMap . , ( , , ). , ConcurrentHashMap , , , . , , .
Java Generics and Collections, 16.4.