For the reentrant lock part, does a thread have to be able to hold both
a shared and a non-shared lock at the same time, or is it just the
non-shared lock that has to be reentrant? In the latter case,
self._lock = RLock() should be enough. In the former case, some extra
work may be needed, yes.
Adding a timeout is probably not too hard, especially as Event already
supports timeouts (as well as Python 3's version of Lock, but well...)
In any case if you think the implementation of SharedLock you used is
the best way to go then so be it, I just want to avoid adding huge
pieces of code to the repo when simpler solutions would be enough.
I haven't followed too much the PyPy side of things either, probably
should do some reading before saying nonsense in my emails :-)
Best,
Antony