瀏覽代碼

Always lock before modiying LRUCache (Issue #2897)

Ask Solem 8 年之前
父節點
當前提交
8c8f1906f5
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      celery/utils/functional.py

+ 1 - 3
celery/utils/functional.py

@@ -67,9 +67,7 @@ class LRUCache(UserDict):
                 for _ in range(len(data) - limit):
                 for _ in range(len(data) - limit):
                     data.popitem(last=False)
                     data.popitem(last=False)
 
 
-    def popitem(self, last=True, _needs_lock=IS_PYPY):
-        if not _needs_lock:
-            return self.data.popitem(last)
+    def popitem(self, last=True):
         with self.mutex:
         with self.mutex:
             return self.data.popitem(last)
             return self.data.popitem(last)