412940 minor threadsafe fixes
412940 minor threadsafe fixes
412940 minor threadsafe fixes

hold lock for accessing elements size