lock caches in case they are shared