@classmethod
def stop_cache_monitor(cls):
    """
        Stop the cache monitor thread. Blocks until the thread stops.
        """
    with cls._monitor_lock:
        cls._stop_thread.set()
        cls._monitor_thread.join()
        cls._monitor_thread = None
