Supporting lock recursion