          SimpleCacheClass.__init__(self, host, params)
          self._lock = RWLock()
  
      def get(self, key, default=None):
          should_delete = False
          self._lock.reader_enters()
          try:
              now = time.time()
 
</s>
    def add(self, key, value, timeout=None):
        self._lock.writer_enters()
        try:
            SimpleCacheClass.add(self, key, value, timeout)
        finally:
            self._lock.writer_leaves()

          SimpleCacheClass.__init__(self, host, params)
          self._lock = RWLock()
  
    def add(self, key, value, timeout=None):
        self._lock.writer_enters()
        try:
            SimpleCacheClass.add(self, key, value, timeout)
        finally:
            self._lock.writer_leaves()

      def get(self, key, default=None):
          should_delete = False
          self._lock.reader_enters()
          try:
              now = time.time()
keep keep add keep keep keep keep keep
 Fixed #4831 -- Added an "add" cache key method, for parity with memcached's
API. This works for all cache backends. Patch from Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6572 bcc190cf-cafb-0310-a4f2-bffc1f526a37
django/core/cache/backends/locmem.py