Skip to content

Commit

Permalink
Fix #54: Add note regarding thread safety.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Nov 3, 2018
1 parent b008c02 commit df982af
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/index.rst
Expand Up @@ -51,6 +51,13 @@ making the cache's size equal to the number of its items, or
named constructor parameter `getsizeof`, which may specify a function
of one argument used to retrieve the size of an item's value.

.. note::

Please be aware that :class:`Cache` and its subclasses are *not*
thread-safe. Access to a shared cache from multiple threads must
be properly synchronized, e.g. by using one of the memoizing
decorators with a suitable `lock` object.


.. autoclass:: Cache(maxsize, getsizeof=None)
:members:
Expand Down

0 comments on commit df982af

Please sign in to comment.