Skip to content

Commit 85bf7c3

Browse files
committed
Indicate that Shelve.sync() is not thread-safe.
1 parent bf21e21 commit 85bf7c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/shelve.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Two additional methods are supported:
7878
dictionary on disk, if feasible. This is called automatically when the shelf
7979
is closed with :meth:`close`.
8080

81+
.. warning::
82+
83+
During the call to :meth:`!sync`, the *writeback* attribute is set to
84+
:const:`False` and other threads will stop updating the cache. As such,
85+
this method is **not** thread-safe.
86+
87+
8188
.. method:: Shelf.close()
8289

8390
Synchronize and close the persistent *dict* object. Operations on a closed

0 commit comments

Comments
 (0)