There are times where recursive locking is necessary and safe. For example, in file system code it is common to lock parent-before-child.
Extend the API to allow such recursive locking policies.
I have a WIP for this.