- ref: https://github.com/r-lib/filelock - a timeout of 1 second should be sufficient - use `base::on.exit()` to unlock on function exit