Can't this serve as back-end for the `lock` function above?