def add_item(self, item):
self._lock.acquire()<EOL>try:<EOL><INDENT>state = item.update_state()<EOL>if state != '<STR_LIT>':<EOL><INDENT>if len(self._items_list) >= self.max_items:<EOL><INDENT>self.purge_items()<EOL><DEDENT>self._items[item.address] = item<EOL>self._items_list.append(item)<EOL>self._items_list.sort()<EOL><DEDENT>return item.state<EOL><DEDENT>finally:<EOL><INDENT>self._lock.release()<EOL><DEDENT>
Add an item to the cache.

        Item state is updated before adding it (it will not be 'new' any more).

        :Parameters:
            - `item`: the item to add.
        :Types:
            - `item`: `CacheItem`

        :return: state of the item after addition.
        :returntype: `str`