This was my first thought and I suppose flock(1) could be used to recreate a lot of this. But it does come with some other quality-of-life improvements like being able to list all currently-used locks, having a lock holdable by N processes etc.
flock is indeed built-in: `flock -xn /tmp/mylock.lock -c "echo running locked command"` does mutex locking in bash. Your tool might offer better ergonomics or features beyond flock's capabilities?
yjftsjthsd-h|7 months ago
anitil|7 months ago
Zacru|7 months ago
I would say one good reason is that
is a lot easier to use and remember thanyjftsjthsd-h|7 months ago
permalac|7 months ago
Flock -s file && script.
Pretty simple. (I forgot the argument, I think is -s..
bigattichouse|7 months ago
waitlock myapp & #... do stuff waitlock --done myapp
ethan_smith|7 months ago