Simplified hash loop in pthread version