private void eventuallyExpand ( int _segmentIndex ) { long [ ] _stamps = lockAll ( ) ; try { long _size = segmentSize [ _segmentIndex ] . get ( ) ; if ( _size <= segmentMaxFill ) { return ; } rehash ( ) ; } finally { unlockAll ( _stamps ) ; } }
Acquire all segment locks and rehash if really needed .