asimap
asimap copied to clipboard
Update the UpgradeableReadWriteLock to support a form of nesting.
For the read lock at least we should be able to make the read_lock() context manager a noop if this task already has the read lock (which we have a method to tell us.)
This way if you try to nest a read lock, it just proceeds. Since the control is entirely in a context manager, the additional nested lock attempts are entirely handled when each level exits its context manager.