The lockfile project is inspired by the man 1 flock utility. I would normally
wrap this sort of functionality in a shell script and use flock if I could. But
now I can see the usefulness of having a simple and shallow idiomatic package
as a project.
Either call the CLI version of the program or include the package and use it
privately. If you use it as part of your application then see the cmd source as
the example for you to follow.