Mercurial > hg
diff setup.py @ 29928:e5a97ec6ebb8
journal: properly check for held lock (issue5349)
The 'jlock' code meant to check for a held lock, but it actually just checking for a
lock object. With CPython, this worked because the 'jlock' object is not
referenced outside the '_write' function so reference counting would garbage
collect it and the '_lockref' would return None. With pypy, the garbage
collection would happen at an undefined time and the '_lockref' can still point
to a 'jlock' object outside of '_write'.
The right thing to do here is not only to check for a lock object but also to
check if the lock is held. We update the code to do so and reuse a utility
method that exist on 'localrepo' to help readability. This fix journal related
tests with pypy.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 13 Sep 2016 20:30:19 +0200 |
parents | a8933d992a71 |
children | 9cc438bf7d9a |