Thread-safe lock-based hash map