Acquire lock before accessing hash tables.