Android LruCache (Android 3.1) thread safety
问题 Is the new Android class LruCache thread safe? The java doc says: This class is thread-safe. Perform multiple cache operations atomically by synchronizing on the cache: synchronized (cache) { if (cache.get(key) == null) { cache.put(key, value); }} Did they mean to say NOT thread-safe? Why would one have to synchronize if the class is thread safe? Thanks! 回答1: Doesn't matter whether the class is thread-safe or not. If you use multiple operations you may still need to synchronize. Depends on