答案是不需要的。
    tab = table,是一个读操作,table被volatile所修饰,所以读的时候一定是安全的,volatile硬件原理保证!!
    只要是针对table操作都是可以保证并发安全的。同时,里面设置的一些全局变量都是又volatile所修饰,就保证了一定程度的并发安全。

    1. /**
    2. * The array of bins. Lazily initialized upon first insertion.
    3. * Size is always a power of two. Accessed directly by iterators.
    4. */
    5. transient volatile Node<K,V>[] table;
    6. public V get(Object key) {
    7. Node<K,V>[] tab; Node<K,V> e, p; int n, eh; K ek;
    8. int h = spread(key.hashCode());
    9. if ((tab = table) != null && (n = tab.length) > 0 &&
    10. (e = tabAt(tab, (n - 1) & h)) != null) {
    11. if ((eh = e.hash) == h) {
    12. if ((ek = e.key) == key || (ek != null && key.equals(ek)))
    13. return e.val;
    14. }
    15. else if (eh < 0)
    16. return (p = e.find(h, key)) != null ? p.val : null;
    17. while ((e = e.next) != null) {
    18. if (e.hash == h &&
    19. ((ek = e.key) == key || (ek != null && key.equals(ek))))
    20. return e.val;
    21. }
    22. }
    23. return null;
    24. }
    25. static final <K,V> Node<K,V> tabAt(Node<K,V>[] tab, int i) {
    26. return (Node<K,V>)U.getObjectVolatile(tab, ((long)i << ASHIFT) + ABASE);
    27. }