A generic partial lock