Maybe wrap this with `try/finally`, to make sure we always unlock?