Maybe include `assert(*lock > 0)`?